Skip to content

Commit 9fa1295

Browse files
committed
Rename op to treatment
1 parent 1edac79 commit 9fa1295

8 files changed

+65
-61
lines changed

Diff for: README.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ pip install brats
4242
### Segmentation
4343
<details>
4444

45-
<summary> <strong> Adult Glioma Segmentation (Pre Operation) </strong> </summary>
45+
<summary> <strong> Adult Glioma Segmentation (Pre Treatment) </strong> </summary>
4646
<br>
4747

4848

4949
```python
50-
from brats import AdultGliomaPreOpSegmenter
51-
from brats.constants import AdultGliomaPreOpAlgorithms
50+
from brats import AdultGliomaPreTreatmentSegmenter
51+
from brats.constants import AdultGliomaPreTreatmentAlgorithms
5252

53-
segmenter = AdultGliomaPreOpSegmenter(algorithm=AdultGliomaPreOpAlgorithms.BraTS23_1, cuda_devices="0")
53+
segmenter = AdultGliomaPreTreatmentSegmenter(algorithm=AdultGliomaPreTreatmentAlgorithms.BraTS23_1, cuda_devices="0")
5454
# these parameters are optional, by default the winning algorithm of 2023 will be used on cuda:0
5555
segmenter.infer_single(
5656
t1c="path/to/t1c.nii.gz",
@@ -61,26 +61,26 @@ segmenter.infer_single(
6161
)
6262
```
6363

64-
**Class:** `brats.AdultGliomaPreOpSegmenter` ([Docs](https://brats.readthedocs.io/en/latest/core/segmentation_algorithms.html#brats.core.segmentation_algorithms.AdultGliomaPreOpSegmenter))
64+
**Class:** `brats.AdultGliomaPreTreatmentSegmenter` ([Docs](https://brats.readthedocs.io/en/latest/core/segmentation_algorithms.html#brats.core.segmentation_algorithms.AdultGliomaPreTreatmentSegmenter))
6565

66-
| Year | Rank | Author | Paper | CPU Support | Key Enum |
67-
| ---- | ---- | --------------------------------- | ------------------------------------------ | ----------- | ----------------------------------------------------------------------------------------------------------------------------- |
68-
| 2023 | 1st | _André Ferreira, et al._ | [Link](https://arxiv.org/abs/2402.17317v1) | &#x274C; | [BraTS23_1](https://brats.readthedocs.io/en/latest/utils/utils.html#brats.constants.**AdultGliomaPreOpAlgorithms**.BraTS23_1) |
69-
| 2023 | 2nd | _Andriy Myronenko, et al._ | N/A | &#x274C; | [BraTS23_2](https://brats.readthedocs.io/en/latest/utils/utils.html#brats.constants.**AdultGliomaPreOpAlgorithms**.BraTS23_2) |
70-
| 2023 | 3rd | _Fadillah Adamsyah Maani, et al._ | N/A | &#x274C; | [BraTS23_3](https://brats.readthedocs.io/en/latest/utils/utils.html#brats.constants.**AdultGliomaPreOpAlgorithms**.BraTS23_3) |
66+
| Year | Rank | Author | Paper | CPU Support | Key Enum |
67+
| ---- | ---- | --------------------------------- | ------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------ |
68+
| 2023 | 1st | _André Ferreira, et al._ | [Link](https://arxiv.org/abs/2402.17317v1) | &#x274C; | [BraTS23_1](https://brats.readthedocs.io/en/latest/utils/utils.html#brats.constants.**AdultGliomaPreTreatmentAlgorithms**.BraTS23_1) |
69+
| 2023 | 2nd | _Andriy Myronenko, et al._ | N/A | &#x274C; | [BraTS23_2](https://brats.readthedocs.io/en/latest/utils/utils.html#brats.constants.**AdultGliomaPreTreatmentAlgorithms**.BraTS23_2) |
70+
| 2023 | 3rd | _Fadillah Adamsyah Maani, et al._ | N/A | &#x274C; | [BraTS23_3](https://brats.readthedocs.io/en/latest/utils/utils.html#brats.constants.**AdultGliomaPreTreatmentAlgorithms**.BraTS23_3) |
7171

7272
</details>
7373

7474
<details>
75-
<summary> <strong> Adult Glioma Segmentation Post Treatment / Operation </strong> </summary>
75+
<summary> <strong> Adult Glioma Segmentation Post Treatment </strong> </summary>
7676
<br>
7777

7878

7979
```python
80-
from brats import AdultGliomaPostOpSegmenter
81-
from brats.constants import AdultGliomaPostOpAlgorithms
80+
from brats import AdultGliomaPostTreatmentSegmenter
81+
from brats.constants import AdultGliomaPostTreatmentAlgorithms
8282

83-
segmenter = AdultGliomaPostOpSegmenter(algorithm=AdultGliomaPostOpAlgorithms.BraTS23_1, cuda_devices="0")
83+
segmenter = AdultGliomaPostTreatmentSegmenter(algorithm=AdultGliomaPostTreatmentAlgorithms.BraTS23_1, cuda_devices="0")
8484
# these parameters are optional, by default the winning algorithm of 2024 will be used on cuda:0
8585
segmenter.infer_single(
8686
t1c="path/to/t1c.nii.gz",
@@ -91,13 +91,13 @@ segmenter.infer_single(
9191
)
9292
```
9393

94-
**Class:** `brats.AdultGliomaPostOpSegmenter` ([Docs](https://brats.readthedocs.io/en/latest/core/segmentation_algorithms.html#brats.core.segmentation_algorithms.AdultGliomaPostOpSegmenter))
94+
**Class:** `brats.AdultGliomaPostTreatmentSegmenter` ([Docs](https://brats.readthedocs.io/en/latest/core/segmentation_algorithms.html#brats.core.segmentation_algorithms.AdultGliomaPostTreatmentSegmenter))
9595

96-
| Year | Rank | Author | Paper | CPU Support | Key Enum |
97-
| ---- | ---- | ------------------------ | ----- | ----------- | -------------------------------------------------------------------------------------------------------------------------- |
98-
| 2024 | 1st | _André Ferreira, et al._ | N/A | &#x274C; | [BraTS24_1](https://brats.readthedocs.io/en/latest/utils/utils.html#brats.constants.AdultGliomaPostOpAlgorithms.BraTS24_1) |
99-
| 2024 | 2nd | _Team kimbab_ | N/A | &#x274C; | [BraTS24_2](https://brats.readthedocs.io/en/latest/utils/utils.html#brats.constants.AdultGliomaPostOpAlgorithms.BraTS24_2) |
100-
| 2024 | 3rd | _Adrian Celaya_ | N/A | &#x2705; | [BraTS24_3](https://brats.readthedocs.io/en/latest/utils/utils.html#brats.constants.AdultGliomaPostOpAlgorithms.BraTS24_3) |
96+
| Year | Rank | Author | Paper | CPU Support | Key Enum |
97+
| ---- | ---- | ------------------------ | ----- | ----------- | --------------------------------------------------------------------------------------------------------------------------------- |
98+
| 2024 | 1st | _André Ferreira, et al._ | N/A | &#x274C; | [BraTS24_1](https://brats.readthedocs.io/en/latest/utils/utils.html#brats.constants.AdultGliomaPostTreatmentAlgorithms.BraTS24_1) |
99+
| 2024 | 2nd | _Team kimbab_ | N/A | &#x274C; | [BraTS24_2](https://brats.readthedocs.io/en/latest/utils/utils.html#brats.constants.AdultGliomaPostTreatmentAlgorithms.BraTS24_2) |
100+
| 2024 | 3rd | _Adrian Celaya_ | N/A | &#x2705; | [BraTS24_3](https://brats.readthedocs.io/en/latest/utils/utils.html#brats.constants.AdultGliomaPostTreatmentAlgorithms.BraTS24_3) |
101101

102102
</details>
103103

Diff for: brats/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from brats.core.inpainting_algorithms import Inpainter
22
from brats.core.segmentation_algorithms import (
3-
AdultGliomaPostOpSegmenter,
4-
AdultGliomaPreOpSegmenter,
3+
AdultGliomaPostTreatmentSegmenter,
4+
AdultGliomaPreTreatmentSegmenter,
55
AfricaSegmenter,
66
MeningiomaSegmenter,
77
MetastasesSegmenter,

Diff for: brats/constants.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ class Algorithms(str, Enum):
2626
pass
2727

2828

29-
class AdultGliomaPostOpAlgorithms(Algorithms):
30-
"""Constants for the available adult glioma post treatment (operation) segmentation algorithms."""
29+
class AdultGliomaPostTreatmentAlgorithms(Algorithms):
30+
"""Constants for the available adult glioma post treatment segmentation algorithms."""
3131

3232
BraTS24_1 = "BraTS24_1"
3333
""" BraTS24 Adult Glioma Segmentation 1st place """
@@ -37,8 +37,8 @@ class AdultGliomaPostOpAlgorithms(Algorithms):
3737
""" BraTS24 Adult Glioma Segmentation 3rd place """
3838

3939

40-
class AdultGliomaPreOpAlgorithms(Algorithms):
41-
"""Constants for the available adult glioma pre treatment (operation) segmentation algorithms."""
40+
class AdultGliomaPreTreatmentAlgorithms(Algorithms):
41+
"""Constants for the available adult glioma pre treatment segmentation algorithms."""
4242

4343
BraTS23_1 = "BraTS23_1"
4444
"""BraTS23 Adult Glioma Segmentation 1st place (GPU only)"""
@@ -149,8 +149,12 @@ class MissingMRIAlgorithms(Algorithms):
149149
ADDITIONAL_FILES_FOLDER = DATA_DIR / "additional_files"
150150

151151
# META DATA FILE PATHS
152-
ADULT_GLIOMA_PRE_OP_SEGMENTATION_ALGORITHMS = META_DIR / "adult_glioma_pre_op.yml"
153-
ADULT_GLIOMA_POST_OP_SEGMENTATION_ALGORITHMS = META_DIR / "adult_glioma_post_op.yml"
152+
ADULT_GLIOMA_PRE_TREATMENT_SEGMENTATION_ALGORITHMS = (
153+
META_DIR / "adult_glioma_pre_treatment.yml"
154+
)
155+
ADULT_GLIOMA_POST_TREATMENT_SEGMENTATION_ALGORITHMS = (
156+
META_DIR / "adult_glioma_post_treatment.yml"
157+
)
154158
MENINGIOMA_SEGMENTATION_ALGORITHMS = META_DIR / "meningioma.yml"
155159
PEDIATRIC_SEGMENTATION_ALGORITHMS = META_DIR / "pediatric.yml"
156160
AFRICA_SEGMENTATION_ALGORITHMS = META_DIR / "africa.yml"

Diff for: brats/core/segmentation_algorithms.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99

1010
from brats.core.brats_algorithm import BraTSAlgorithm
1111
from brats.constants import (
12-
ADULT_GLIOMA_POST_OP_SEGMENTATION_ALGORITHMS,
13-
ADULT_GLIOMA_PRE_OP_SEGMENTATION_ALGORITHMS,
12+
ADULT_GLIOMA_POST_TREATMENT_SEGMENTATION_ALGORITHMS,
13+
ADULT_GLIOMA_PRE_TREATMENT_SEGMENTATION_ALGORITHMS,
1414
AFRICA_SEGMENTATION_ALGORITHMS,
1515
MENINGIOMA_SEGMENTATION_ALGORITHMS,
1616
METASTASES_SEGMENTATION_ALGORITHMS,
1717
PEDIATRIC_SEGMENTATION_ALGORITHMS,
18-
AdultGliomaPostOpAlgorithms,
19-
AdultGliomaPreOpAlgorithms,
18+
AdultGliomaPostTreatmentAlgorithms,
19+
AdultGliomaPreTreatmentAlgorithms,
2020
AfricaAlgorithms,
2121
Algorithms,
2222
MeningiomaAlgorithms,
@@ -186,47 +186,47 @@ def infer_batch(
186186
)
187187

188188

189-
class AdultGliomaPreOpSegmenter(SegmentationAlgorithm):
190-
"""Provides algorithms to perform tumor segmentation on adult glioma pre treatment/ operation MRI data.
189+
class AdultGliomaPreTreatmentSegmenter(SegmentationAlgorithm):
190+
"""Provides algorithms to perform tumor segmentation on adult glioma pre treatment MRI data.
191191
192192
Args:
193-
algorithm (AdultGliomaPreOpAlgorithms, optional): Select an algorithm. Defaults to AdultGliomaPreOpAlgorithms.BraTS23_1.
193+
algorithm (AdultGliomaPreTreatmentAlgorithms, optional): Select an algorithm. Defaults to AdultGliomaPreTreatmentAlgorithms.BraTS23_1.
194194
cuda_devices (Optional[str], optional): Which cuda devices to use. Defaults to "0".
195195
force_cpu (bool, optional): Execution will default to GPU, this flag allows forced CPU execution if the algorithm is compatible. Defaults to False.
196196
"""
197197

198198
def __init__(
199199
self,
200-
algorithm: AdultGliomaPreOpAlgorithms = AdultGliomaPreOpAlgorithms.BraTS23_1,
200+
algorithm: AdultGliomaPreTreatmentAlgorithms = AdultGliomaPreTreatmentAlgorithms.BraTS23_1,
201201
cuda_devices: Optional[str] = "0",
202202
force_cpu: bool = False,
203203
):
204204
super().__init__(
205205
algorithm=algorithm,
206-
algorithms_file_path=ADULT_GLIOMA_PRE_OP_SEGMENTATION_ALGORITHMS,
206+
algorithms_file_path=ADULT_GLIOMA_PRE_TREATMENT_SEGMENTATION_ALGORITHMS,
207207
cuda_devices=cuda_devices,
208208
force_cpu=force_cpu,
209209
)
210210

211211

212-
class AdultGliomaPostOpSegmenter(SegmentationAlgorithm):
213-
"""Provides algorithms to perform tumor segmentation on adult glioma post treatment/ operation MRI data.
212+
class AdultGliomaPostTreatmentSegmenter(SegmentationAlgorithm):
213+
"""Provides algorithms to perform tumor segmentation on adult glioma post treatment MRI data.
214214
215215
Args:
216-
algorithm (AdultGliomaPostOpAlgorithms, optional): Select an algorithm. Defaults to AdultGliomaPostOpAlgorithms.BraTS24_1.
216+
algorithm (AdultGliomaPostTreatmentAlgorithms, optional): Select an algorithm. Defaults to AdultGliomaPostTreatmentAlgorithms.BraTS24_1.
217217
cuda_devices (Optional[str], optional): Which cuda devices to use. Defaults to "0".
218218
force_cpu (bool, optional): Execution will default to GPU, this flag allows forced CPU execution if the algorithm is compatible. Defaults to False.
219219
"""
220220

221221
def __init__(
222222
self,
223-
algorithm: AdultGliomaPostOpAlgorithms = AdultGliomaPostOpAlgorithms.BraTS24_1,
223+
algorithm: AdultGliomaPostTreatmentAlgorithms = AdultGliomaPostTreatmentAlgorithms.BraTS24_1,
224224
cuda_devices: Optional[str] = "0",
225225
force_cpu: bool = False,
226226
):
227227
super().__init__(
228228
algorithm=algorithm,
229-
algorithms_file_path=ADULT_GLIOMA_POST_OP_SEGMENTATION_ALGORITHMS,
229+
algorithms_file_path=ADULT_GLIOMA_POST_TREATMENT_SEGMENTATION_ALGORITHMS,
230230
cuda_devices=cuda_devices,
231231
force_cpu=force_cpu,
232232
)

Diff for: brats/data/meta/adult_glioma_post_op.yml renamed to brats/data/meta/adult_glioma_post_treatment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
constants:
22
input_name_schema: &input_name_schema "BraTS-GLI-{id:05d}-000"
3-
challenge: &challenge "Adult Glioma Post Treatment Segmentation"
3+
challenge: &challenge "Adult Glioma Segmentation (Post Treatment)"
44
years:
55
2024: &year_2024 2024
66
ranks:

Diff for: brats/data/meta/adult_glioma_pre_op.yml renamed to brats/data/meta/adult_glioma_pre_treatment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
constants:
22
input_name_schema: &input_name_schema "BraTS-GLI-{id:05d}-000"
3-
challenge: &challenge "Adult Glioma Segmentation (Pre Operation)"
3+
challenge: &challenge "Adult Glioma Segmentation (Pre Treatment)"
44
years:
55
2023: &year_2023 2023
66
ranks:

Diff for: tests/core/test_brats_algorithm.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import tempfile
55
import shutil
66

7-
from brats import AdultGliomaPostOpSegmenter
7+
from brats import AdultGliomaPostTreatmentSegmenter
88
from brats.constants import OUTPUT_NAME_SCHEMA
99

1010

@@ -31,7 +31,7 @@ def setUp(self):
3131
file.touch()
3232

3333
# the core inference method is the same for all segmentation and inpainting algorithms, we use AdultGliomaSegmenter as an example during testing
34-
self.segmenter = AdultGliomaPostOpSegmenter()
34+
self.segmenter = AdultGliomaPostTreatmentSegmenter()
3535

3636
def tearDown(self):
3737
# Remove the temporary directory after the test

Diff for: tests/core/test_segmentation_algorithms.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
from loguru import logger
88

99
from brats import (
10-
AdultGliomaPostOpSegmenter,
11-
AdultGliomaPreOpSegmenter,
10+
AdultGliomaPostTreatmentSegmenter,
11+
AdultGliomaPreTreatmentSegmenter,
1212
AfricaSegmenter,
1313
MeningiomaSegmenter,
1414
MetastasesSegmenter,
1515
PediatricSegmenter,
1616
)
1717
from brats.constants import (
18-
AdultGliomaPostOpAlgorithms,
19-
AdultGliomaPreOpAlgorithms,
18+
AdultGliomaPostTreatmentAlgorithms,
19+
AdultGliomaPreTreatmentAlgorithms,
2020
AfricaAlgorithms,
2121
MeningiomaAlgorithms,
2222
MetastasesAlgorithms,
@@ -44,7 +44,7 @@ def setUp(self):
4444
for img in [self.t1c, self.t1n, self.t2f, self.t2w]:
4545
img.touch(exist_ok=True)
4646

47-
self.segmenter = AdultGliomaPostOpSegmenter()
47+
self.segmenter = AdultGliomaPostTreatmentSegmenter()
4848

4949
def tearDown(self):
5050
# Remove the temporary directory after the test
@@ -118,29 +118,29 @@ def test_standardize_segmentation_inputs_list(self, mock_standardize_single_inpu
118118

119119
def test_adult_glioma_pre_op_segmenter_initialization(self):
120120
# Test default initialization
121-
segmenter = AdultGliomaPreOpSegmenter()
122-
self.assertIsInstance(segmenter, AdultGliomaPreOpSegmenter)
121+
segmenter = AdultGliomaPreTreatmentSegmenter()
122+
self.assertIsInstance(segmenter, AdultGliomaPreTreatmentSegmenter)
123123

124124
# Test with custom arguments
125-
custom_segmenter = AdultGliomaPreOpSegmenter(
126-
algorithm=AdultGliomaPreOpAlgorithms.BraTS23_2,
125+
custom_segmenter = AdultGliomaPreTreatmentSegmenter(
126+
algorithm=AdultGliomaPreTreatmentAlgorithms.BraTS23_2,
127127
cuda_devices="1",
128128
force_cpu=True,
129129
)
130-
self.assertIsInstance(custom_segmenter, AdultGliomaPreOpSegmenter)
130+
self.assertIsInstance(custom_segmenter, AdultGliomaPreTreatmentSegmenter)
131131

132132
def test_adult_glioma_post_op_segmenter_initialization(self):
133133
# Test default initialization
134-
segmenter = AdultGliomaPostOpSegmenter()
135-
self.assertIsInstance(segmenter, AdultGliomaPostOpSegmenter)
134+
segmenter = AdultGliomaPostTreatmentSegmenter()
135+
self.assertIsInstance(segmenter, AdultGliomaPostTreatmentSegmenter)
136136

137137
# Test with custom arguments
138-
custom_segmenter = AdultGliomaPostOpSegmenter(
139-
algorithm=AdultGliomaPostOpAlgorithms.BraTS24_2,
138+
custom_segmenter = AdultGliomaPostTreatmentSegmenter(
139+
algorithm=AdultGliomaPostTreatmentAlgorithms.BraTS24_2,
140140
cuda_devices="1",
141141
force_cpu=True,
142142
)
143-
self.assertIsInstance(custom_segmenter, AdultGliomaPostOpSegmenter)
143+
self.assertIsInstance(custom_segmenter, AdultGliomaPostTreatmentSegmenter)
144144

145145
def test_meningioma_segmenter_initialization(self):
146146
# Test default initialization

0 commit comments

Comments
 (0)