BraTS 0.0.0.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. brats/__init__.py +16 -0
  2. brats/constants.py +268 -0
  3. brats/core/__init__.py +0 -0
  4. brats/core/brats_algorithm.py +264 -0
  5. brats/core/docker.py +474 -0
  6. brats/core/inpainting_algorithms.py +155 -0
  7. brats/core/missing_mri_algorithms.py +185 -0
  8. brats/core/segmentation_algorithms.py +491 -0
  9. brats/core/singularity.py +268 -0
  10. brats/data/meta/adult_glioma_pre_and_post_treatment.yml +123 -0
  11. brats/data/meta/adult_glioma_pre_treatment.yml +64 -0
  12. brats/data/meta/africa.yml +185 -0
  13. brats/data/meta/goat.yml +84 -0
  14. brats/data/meta/inpainting.yml +163 -0
  15. brats/data/meta/meningioma.yml +96 -0
  16. brats/data/meta/meningioma_rt.yml +113 -0
  17. brats/data/meta/metastases.yml +94 -0
  18. brats/data/meta/missing_mri.yml +125 -0
  19. brats/data/meta/pediatric.yml +168 -0
  20. brats/data/parameters/brats23_africa_sparkunn.yml +63 -0
  21. brats/data/parameters/brats23_inpainting_domaso.yml +44 -0
  22. brats/data/parameters/brats23_missing_mri_onembyte.yml +5 -0
  23. brats/data/parameters/brats24_adult_glioma_mist.yml +6 -0
  24. brats/data/parameters/brats24_inpainting_smint.yml +37 -0
  25. brats/data/parameters/brats24_missing_mri_cgv.yml +72 -0
  26. brats/data/parameters/dummy.yml +0 -0
  27. brats/preprocessing.py +435 -0
  28. brats/utils/__init__.py +0 -0
  29. brats/utils/algorithm_config.py +102 -0
  30. brats/utils/data_handling.py +116 -0
  31. brats/utils/exceptions.py +25 -0
  32. brats/utils/logging.py +73 -0
  33. brats/utils/zenodo.py +217 -0
  34. brats-0.0.0.dev0.dist-info/METADATA +581 -0
  35. brats-0.0.0.dev0.dist-info/RECORD +37 -0
  36. brats-0.0.0.dev0.dist-info/WHEEL +4 -0
  37. brats-0.0.0.dev0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,168 @@
1
+ constants:
2
+ input_name_schema: &input_name_schema "BraTS-PED-{id:05d}-000"
3
+ challenge: &challenge "Pediatric Segmentation"
4
+ challenge_manuscript:
5
+ 2025: &challenge_manuscript_2025 "https://arxiv.org/abs/2404.15009" # same as 2024
6
+ 2024: &challenge_manuscript_2024 "https://arxiv.org/abs/2404.15009"
7
+ 2023: &challenge_manuscript_2023 "https://arxiv.org/abs/2305.17033"
8
+ years:
9
+ 2025: &year_2025 2025
10
+ 2024: &year_2024 2024
11
+ 2023: &year_2023 2023
12
+ ranks:
13
+ 1st: &rank_1 1st
14
+ 2nd: &rank_2 2nd
15
+ 3rd: &rank_3 3rd
16
+
17
+ algorithms:
18
+
19
+ ##### 2025 #####
20
+ BraTS25_1:
21
+ meta:
22
+ authors: Yuxiao Yi, et al.
23
+ paper: N/A
24
+ challenge: *challenge
25
+ challenge_manuscript: *challenge_manuscript_2025
26
+ rank: *rank_1
27
+ year: *year_2025
28
+ run_args:
29
+ docker_image: brainles/brats25_ped_joeyx:latest
30
+ input_name_schema: *input_name_schema
31
+ requires_root: true
32
+
33
+ BraTS25_2:
34
+ meta:
35
+ authors: Meng-Yuan Chen, et al.
36
+ paper: N/A
37
+ challenge: *challenge
38
+ challenge_manuscript: *challenge_manuscript_2025
39
+ rank: *rank_2
40
+ year: *year_2025
41
+ run_args:
42
+ docker_image: brainles/brats25_ped_cmengynn:latest
43
+ input_name_schema: *input_name_schema
44
+ requires_root: true
45
+
46
+ BraTS25_3:
47
+ meta:
48
+ authors: Yu Haitao, et al.
49
+ paper: N/A
50
+ challenge: *challenge
51
+ challenge_manuscript: *challenge_manuscript_2025
52
+ rank: *rank_3
53
+ year: *year_2025
54
+ run_args:
55
+ docker_image: brainles/brats25_ped_qing:latest
56
+ input_name_schema: *input_name_schema
57
+ requires_root: true
58
+
59
+ # BraTS25_4?: # Removed after ranking updated
60
+ # meta:
61
+ # authors: Xiaolong Li, et al.
62
+ # paper: N/A
63
+ # challenge: *challenge
64
+ # challenge_manuscript: *challenge_manuscript_2025
65
+ # rank: *rank_1
66
+ # year: *year_2025
67
+ # run_args:
68
+ # docker_image: brainles/brats25_ped_s1mpleee:latest
69
+ # input_name_schema: *input_name_schema
70
+ # requires_root: true
71
+
72
+
73
+ ##### 2024 #####
74
+ BraTS24_1:
75
+ meta:
76
+ authors: Mehdi Astaraki, et al.
77
+ paper: N/A
78
+ challenge: *challenge
79
+ challenge_manuscript: *challenge_manuscript_2024
80
+ rank: *rank_1
81
+ year: *year_2024
82
+ run_args:
83
+ docker_image: brainles/brats24_pediatric_astaraki:latest
84
+ input_name_schema: *input_name_schema
85
+ requires_root: false
86
+ parameters_file: true
87
+ shm_size: "8gb"
88
+
89
+ BraTS24_2:
90
+ meta:
91
+ authors: Tim Mulvany, et al.
92
+ paper: https://doi.org/10.48550/arXiv.2410.14020
93
+ challenge: *challenge
94
+ challenge_manuscript: *challenge_manuscript_2024
95
+ rank: *rank_2
96
+ year: *year_2024
97
+ run_args:
98
+ docker_image: brainles/brats24_pediatric_aipni:latest
99
+ input_name_schema: *input_name_schema
100
+ requires_root: false
101
+ parameters_file: true
102
+ shm_size: "8gb"
103
+ additional_files:
104
+ record_id: "14446259"
105
+
106
+ BraTS24_3:
107
+ meta:
108
+ authors: Sarim Hashmi, et al.
109
+ paper: https://arxiv.org/abs/2411.15872
110
+ challenge: *challenge
111
+ challenge_manuscript: *challenge_manuscript_2024
112
+ rank: *rank_3
113
+ year: *year_2024
114
+ run_args:
115
+ docker_image: brainles/brats24_pediatric_biomedia-mbzu:latest
116
+ input_name_schema: *input_name_schema
117
+ requires_root: false
118
+ parameters_file: true
119
+ shm_size: "2gb"
120
+ additional_files:
121
+ record_id: "14446377"
122
+ param_name: ["checkpoint_dir"]
123
+
124
+ ##### 2023 #####
125
+ BraTS23_1:
126
+ meta:
127
+ authors: Daniel Capellán-Martín et al.
128
+ paper: https://api.semanticscholar.org/CorpusID:272599903
129
+ challenge: *challenge
130
+ challenge_manuscript: *challenge_manuscript_2023
131
+ rank: *rank_1
132
+ year: *year_2023
133
+ run_args:
134
+ docker_image: brainles/brats23_pediatric_cnmc_pmi2023:latest
135
+ input_name_schema: *input_name_schema
136
+ requires_root: true
137
+ parameters_file: false
138
+ shm_size: "2gb"
139
+
140
+ BraTS23_2:
141
+ meta:
142
+ authors: Andriy Myronenko, et al.
143
+ paper: N/A
144
+ challenge: *challenge
145
+ challenge_manuscript: *challenge_manuscript_2023
146
+ rank: *rank_2
147
+ year: *year_2023
148
+ run_args:
149
+ docker_image: brainles/brats23_pediatric_nvauto:latest
150
+ input_name_schema: *input_name_schema
151
+ requires_root: true
152
+ parameters_file: true
153
+ shm_size: "32gb"
154
+
155
+ BraTS23_3:
156
+ meta:
157
+ authors: Yubo Zhou
158
+ paper: https://doi.org/10.1007/978-3-031-76163-8_5
159
+ challenge: *challenge
160
+ challenge_manuscript: *challenge_manuscript_2023
161
+ rank: *rank_3
162
+ year: *year_2023
163
+ run_args:
164
+ docker_image: brainles/brats23_pediatric_sherlock_zyb:latest
165
+ input_name_schema: *input_name_schema
166
+ requires_root: false
167
+ parameters_file: false
168
+ shm_size: "10gb"
@@ -0,0 +1,63 @@
1
+ # Arguments of the data_preparation.py script
2
+
3
+ # Arguments of the preprocess.py script
4
+ prep_exec_mode: test
5
+ ohe: true
6
+ verbose: true
7
+ task: "12" # testing
8
+ dim: 3
9
+ n_jobs: -1
10
+
11
+ # Arguments of the main.py script
12
+ exec_mode: predict
13
+ config: None
14
+ logname : logs.json
15
+ gpus: 1
16
+ nodes: 1
17
+ learning_rate: 0.0003
18
+ gradient_clip_val: 0
19
+ negative_slope: 0.01
20
+ tta: true
21
+ brats: true
22
+ deep_supervision: false
23
+ invert_resampled_y: false
24
+ amp: true
25
+ benchmark: false
26
+ focal: false
27
+ save_ckpt: false
28
+ nfolds: 10
29
+ seed: null # "Random seed
30
+ skip_first_n_eval: 0 # Skip the evaluation for the first n epochs.
31
+ # ckpt_path: null # Path for loading checkpoint #?
32
+ # ckpt_store_dir: $results # Path for saving checkpoint #?
33
+ # fold: 2 # Fold number
34
+ patience: 100 # Early stopping patience
35
+ batch_size: 2 # Batch size
36
+ val_batch_size: 4 # Validation batch size
37
+ momentum: 0.99 # Momentum factor
38
+ weight_decay: 0.0001 #Weight decay (L2 penalty)
39
+ save_preds: true # Enable prediction saving
40
+ dim: 3 # UNet dimension
41
+ resume_training: false # Resume training from the last checkpoint
42
+ num_workers: 8 # Number of subprocesses to use for data loading
43
+ epochs: 150 # Number of training epochs.
44
+ warmup: 5 # Warmup iterations before collecting statistics
45
+ nvol: 4 #Number of volumes which come into single batch size for 2D model
46
+ depth: 5 # The depth of the encoder
47
+ min_fmap: 4 #Minimal dimension of feature map in the bottleneck
48
+ deep_supr_num: 2 # Number of deep supervision heads
49
+ res_block: false # Enable residual blocks
50
+ filters: null # nargs="+", help="[Optional] Set U-Net filters"
51
+ layout: NCDHW
52
+ brats22_model: true # Use BraTS22 model
53
+ norm: instance # Normalization layer
54
+ data2d_dim: 3 # Input data dimension for 2d model
55
+ oversampling: 0.4 # Probability of crop to have some region with positive label
56
+ overlap: 0.25 # Amount of overlap between scans during sliding window inference
57
+ scheduler: true # Enable cosine rate scheduler with warmup
58
+ optimizer: adam # Optimizer
59
+ blend: constant # How to blend output of overlapping windows
60
+ train_batches: 0 # Limit number of batches for training (used for benchmarking mode only)
61
+ test_batches: 0 # Limit number of batches for inference (used for benchmarking mode only)
62
+
63
+ # Argument for the postprocess.py script
@@ -0,0 +1,44 @@
1
+ slices_per_sampling: 32 # can be adjusted depending on GPU space, defines how many slices are sampled simultaneously
2
+ gpu_id: 'cuda:0'
3
+ attention_resolutions: '16'
4
+ batch_size: 8
5
+ channel_mult: ''
6
+ class_cond: False
7
+ data_dir: '' #./data_3d/raw_data_test'
8
+ diffusion_steps: 1000
9
+ dropout: 0.0
10
+ ema_rate: '0.9999'
11
+ fp16_scale_growth: 0.001
12
+ image_size: 256
13
+ learn_sigma: True
14
+ log_interval: 1000
15
+ lr: 0.0001
16
+ lr_anneal_steps: 0
17
+ microbatch: -1
18
+ noise_schedule: 'linear'
19
+ num_channels: 128
20
+ num_head_channels: -1
21
+ num_heads: 1
22
+ num_heads_upsample: -1
23
+ num_res_blocks: 2
24
+ predict_xstart: False
25
+ resblock_updown: False
26
+ rescale_learned_sigmas: False
27
+ rescale_timesteps: False
28
+ resume_checkpoint: '' #./results_BraTS_transversal/savedmodel2170000.pt'
29
+ save_interval: 5000
30
+ schedule_sampler: 'uniform'
31
+ timestep_respacing: ''
32
+ use_checkpoint: False
33
+ use_fp16: False
34
+ use_kl: False
35
+ use_new_attention_order: False
36
+ use_scale_shift_norm: False
37
+ weight_decay: 0.0
38
+ num_samples: 1
39
+ use_ddim: False
40
+ clip_denoised: True,
41
+ num_ensemble: 1
42
+ #log_dir: 'predictions/'
43
+ #model_path: 'additional_files/savedmodel2850000.pt'
44
+ #data_dir: 'data/'
@@ -0,0 +1,5 @@
1
+ t1n_model: t1n_model # logs/train/2023-08-01/08-19-59_w2aorpx3
2
+ t1c_model: t1c_model # logs/train/2023-08-01/08-12-49_t75jck2e
3
+ t2w_model: t2w_model # logs/train/2023-08-01/08-41-30_b24whwna
4
+ t2f_model: t2f_model # logs/train/2023-08-01/08-54-29_hnx3ttp6
5
+ phase: test
@@ -0,0 +1,6 @@
1
+ fast_inference: False
2
+ overlap: 0.5
3
+ blend_mode: "gaussian"
4
+ tta: True
5
+ no_preprocess: False
6
+ output_std: False
@@ -0,0 +1,37 @@
1
+ attention_resolutions: '16'
2
+ batch_size: 1
3
+ channel_mult: ''
4
+ class_cond: False
5
+ clip_denoised: True
6
+ diffusion_steps: 1000
7
+ dropout: 0.0
8
+ ema_rate: '0.9999'
9
+ fp16_scale_growth: 0.001
10
+ image_size: 256
11
+ learn_sigma: True
12
+ log_interval: 1000
13
+ lr: 0.0001
14
+ lr_anneal_steps: 0
15
+ microbatch: -1
16
+ noise_schedule: 'linear'
17
+ num_channels: 128
18
+ num_head_channels: -1
19
+ num_heads: 1
20
+ num_heads_upsample: -1
21
+ num_res_blocks: 2
22
+ predict_xstart: False
23
+ resblock_updown: False
24
+ rescale_learned_sigmas: False
25
+ rescale_timesteps: False
26
+ resume_checkpoint: ''
27
+ save_interval: 5000
28
+ schedule_sampler: 'uniform'
29
+ subbatch: 16
30
+ timestep_respacing: ''
31
+ use_checkpoint: False
32
+ use_ddim: False
33
+ use_fp16: False
34
+ use_kl: False
35
+ use_new_attention_order: False
36
+ use_scale_shift_norm: False
37
+ weight_decay: 0.0
@@ -0,0 +1,72 @@
1
+ previous_exp_name: does_not_exist
2
+ exp_name: refiner_fets_minmax_l1No_ssimYes_DiceYes
3
+
4
+ # seg_model:
5
+ # seg_exp_name: seg_testing_merge
6
+ # path_suffix: epoch_100.pth
7
+
8
+ dataset:
9
+ root: "/data_folder/"
10
+ folders: ["ASNR-MICCAI-BraTS2023-GLI-Challenge-TrainingData"]
11
+ val_folder: ["ASNR-MICCAI-BraTS2023-GLI-Challenge-ValidationData"]
12
+ suffix_modalities: ["t1", "t1ce", "t2", "flair"]
13
+ suffix_common: ".nii.gz"
14
+ resize: False
15
+ resize_input: 256
16
+ resize_output: 256
17
+ crop: True
18
+ random_crop: True
19
+ crop_size: 128
20
+ pad: True
21
+ normalize: True
22
+ norm_method: zscore # OPTIONS - minmax01: [0,1], minmax11: [-1,1], zscore: z-score normalization
23
+ mask_input: False
24
+ mask_modality: True
25
+
26
+ dataloader:
27
+ batch_size: 1
28
+ shuffle: True
29
+ num_workers: 1
30
+
31
+ model:
32
+ spatial_dims: 3
33
+ in_channels: 4
34
+ out_channels: 4
35
+ latent_channels: 3
36
+ num_channels: [64, 128, 128, 128]
37
+ num_res_blocks: 1
38
+ norm_num_groups: 32
39
+ norm_eps: 1.0e-6
40
+ attention_levels: [
41
+ False,
42
+ False,
43
+ False,
44
+ False
45
+ ]
46
+ with_encoder_nonlocal_attn: False
47
+ with_decoder_nonlocal_attn: False
48
+ use_skip_connection: True
49
+ use_skip_squeeze: True
50
+ skip_squeeze_channels: 1
51
+ use_skip_connection_first_layer: False
52
+ skip_drop_rate: 0.0
53
+ training: True
54
+
55
+ refiner:
56
+ hidden_size: 64
57
+ output_residual: True
58
+ use_final_conv: True
59
+
60
+ discriminator:
61
+ hidden_size: 64
62
+
63
+ training:
64
+ epoch: 1000
65
+ lr: 1.0e-5
66
+ cp_epoch: 2
67
+ pic_log_epoch: 1
68
+ cp_directory: "./checkpoints/"
69
+ use_scheduler: True
70
+ load_checkpoint: False
71
+ mask_loss_amp: 8.0
72
+ loss_coef: [1.0, 1.0] # [L1, MSE]
File without changes