fastMONAI 0.5.1__tar.gz → 0.5.2__tar.gz
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.
- {fastmonai-0.5.1/fastMONAI.egg-info → fastmonai-0.5.2}/PKG-INFO +7 -7
- {fastmonai-0.5.1 → fastmonai-0.5.2}/README.md +6 -6
- fastmonai-0.5.2/fastMONAI/__init__.py +1 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI/_modidx.py +13 -1
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI/vision_augmentation.py +102 -18
- {fastmonai-0.5.1 → fastmonai-0.5.2/fastMONAI.egg-info}/PKG-INFO +7 -7
- {fastmonai-0.5.1 → fastmonai-0.5.2}/settings.ini +2 -2
- fastmonai-0.5.1/fastMONAI/__init__.py +0 -1
- {fastmonai-0.5.1 → fastmonai-0.5.2}/CONTRIBUTING.md +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/LICENSE +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/MANIFEST.in +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI/dataset_info.py +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI/external_data.py +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI/research_utils.py +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI/utils.py +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI/vision_all.py +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI/vision_core.py +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI/vision_data.py +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI/vision_inference.py +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI/vision_loss.py +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI/vision_metrics.py +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI/vision_plot.py +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI.egg-info/SOURCES.txt +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI.egg-info/dependency_links.txt +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI.egg-info/entry_points.txt +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI.egg-info/not-zip-safe +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI.egg-info/requires.txt +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/fastMONAI.egg-info/top_level.txt +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/pyproject.toml +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/setup.cfg +0 -0
- {fastmonai-0.5.1 → fastmonai-0.5.2}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastMONAI
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: fastMONAI library
|
|
5
5
|
Home-page: https://github.com/MMIV-ML/fastMONAI
|
|
6
6
|
Author: Satheshkumar Kaliyugarasan
|
|
@@ -53,7 +53,7 @@ Dynamic: summary
|
|
|
53
53
|
|
|
54
54
|
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
|
|
55
55
|
|
|
56
|
-

|
|
57
57
|
|
|
58
58
|

|
|
59
59
|
[](https://fastmonai.no)
|
|
@@ -120,15 +120,15 @@ https://fastmonai.no for more information.
|
|
|
120
120
|
|
|
121
121
|
| Notebook | 1-Click Notebook |
|
|
122
122
|
|:---|----|
|
|
123
|
-
| [10a_tutorial_classification.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/
|
|
124
|
-
| [10b_tutorial_regression.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/
|
|
125
|
-
| [10c_tutorial_binary_segmentation.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/
|
|
126
|
-
| [10d_tutorial_multiclass_segmentation.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/
|
|
123
|
+
| [10a_tutorial_classification.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/main/nbs/10a_tutorial_classification.ipynb) <br>shows how to construct a binary classification model based on MRI data. | [](https://colab.research.google.com/github/MMIV-ML/fastMONAI/blob/main/nbs/10a_tutorial_classification.ipynb) |
|
|
124
|
+
| [10b_tutorial_regression.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/main/nbs/10b_tutorial_regression.ipynb) <br>shows how to construct a model to predict the age of a subject from MRI scans (“brain age”). | [](https://colab.research.google.com/github/MMIV-ML/fastMONAI/blob/main/nbs/10b_tutorial_regression.ipynb) |
|
|
125
|
+
| [10c_tutorial_binary_segmentation.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/main/nbs/10c_tutorial_binary_segmentation.ipynb) <br>shows how to do binary segmentation (extract the left atrium from monomodal cardiac MRI). | [](https://colab.research.google.com/github/MMIV-ML/fastMONAI/blob/main/nbs/10c_tutorial_binary_segmentation.ipynb) |
|
|
126
|
+
| [10d_tutorial_multiclass_segmentation.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/main/nbs/10d_tutorial_multiclass_segmentation.ipynb) <br>shows how to perform segmentation from multimodal MRI (brain tumor segmentation). | [](https://colab.research.google.com/github/MMIV-ML/fastMONAI/blob/main/nbs/10d_tutorial_multiclass_segmentation.ipynb) |
|
|
127
127
|
|
|
128
128
|
# How to contribute
|
|
129
129
|
|
|
130
130
|
We welcome contributions! See
|
|
131
|
-
[CONTRIBUTING.md](https://github.com/MMIV-ML/fastMONAI/blob/
|
|
131
|
+
[CONTRIBUTING.md](https://github.com/MMIV-ML/fastMONAI/blob/main/CONTRIBUTING.md)
|
|
132
132
|
|
|
133
133
|
# Citing fastMONAI
|
|
134
134
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
|
|
5
5
|
|
|
6
|
-

|
|
7
7
|
|
|
8
8
|

|
|
9
9
|
[](https://fastmonai.no)
|
|
@@ -70,15 +70,15 @@ https://fastmonai.no for more information.
|
|
|
70
70
|
|
|
71
71
|
| Notebook | 1-Click Notebook |
|
|
72
72
|
|:---|----|
|
|
73
|
-
| [10a_tutorial_classification.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/
|
|
74
|
-
| [10b_tutorial_regression.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/
|
|
75
|
-
| [10c_tutorial_binary_segmentation.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/
|
|
76
|
-
| [10d_tutorial_multiclass_segmentation.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/
|
|
73
|
+
| [10a_tutorial_classification.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/main/nbs/10a_tutorial_classification.ipynb) <br>shows how to construct a binary classification model based on MRI data. | [](https://colab.research.google.com/github/MMIV-ML/fastMONAI/blob/main/nbs/10a_tutorial_classification.ipynb) |
|
|
74
|
+
| [10b_tutorial_regression.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/main/nbs/10b_tutorial_regression.ipynb) <br>shows how to construct a model to predict the age of a subject from MRI scans (“brain age”). | [](https://colab.research.google.com/github/MMIV-ML/fastMONAI/blob/main/nbs/10b_tutorial_regression.ipynb) |
|
|
75
|
+
| [10c_tutorial_binary_segmentation.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/main/nbs/10c_tutorial_binary_segmentation.ipynb) <br>shows how to do binary segmentation (extract the left atrium from monomodal cardiac MRI). | [](https://colab.research.google.com/github/MMIV-ML/fastMONAI/blob/main/nbs/10c_tutorial_binary_segmentation.ipynb) |
|
|
76
|
+
| [10d_tutorial_multiclass_segmentation.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/main/nbs/10d_tutorial_multiclass_segmentation.ipynb) <br>shows how to perform segmentation from multimodal MRI (brain tumor segmentation). | [](https://colab.research.google.com/github/MMIV-ML/fastMONAI/blob/main/nbs/10d_tutorial_multiclass_segmentation.ipynb) |
|
|
77
77
|
|
|
78
78
|
# How to contribute
|
|
79
79
|
|
|
80
80
|
We welcome contributions! See
|
|
81
|
-
[CONTRIBUTING.md](https://github.com/MMIV-ML/fastMONAI/blob/
|
|
81
|
+
[CONTRIBUTING.md](https://github.com/MMIV-ML/fastMONAI/blob/main/CONTRIBUTING.md)
|
|
82
82
|
|
|
83
83
|
# Citing fastMONAI
|
|
84
84
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.5.2"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Autogenerated by nbdev
|
|
2
2
|
|
|
3
|
-
d = { 'settings': { 'branch': '
|
|
3
|
+
d = { 'settings': { 'branch': 'main',
|
|
4
4
|
'doc_baseurl': '/',
|
|
5
5
|
'doc_host': 'https://fastmonai.no',
|
|
6
6
|
'git_url': 'https://github.com/MMIV-ML/fastMONAI',
|
|
@@ -99,6 +99,12 @@ d = { 'settings': { 'branch': 'master',
|
|
|
99
99
|
'fastMONAI/vision_augmentation.py'),
|
|
100
100
|
'fastMONAI.vision_augmentation.CustomDictTransform.encodes': ( 'vision_augment.html#customdicttransform.encodes',
|
|
101
101
|
'fastMONAI/vision_augmentation.py'),
|
|
102
|
+
'fastMONAI.vision_augmentation.NormalizeIntensity': ( 'vision_augment.html#normalizeintensity',
|
|
103
|
+
'fastMONAI/vision_augmentation.py'),
|
|
104
|
+
'fastMONAI.vision_augmentation.NormalizeIntensity.__init__': ( 'vision_augment.html#normalizeintensity.__init__',
|
|
105
|
+
'fastMONAI/vision_augmentation.py'),
|
|
106
|
+
'fastMONAI.vision_augmentation.NormalizeIntensity.encodes': ( 'vision_augment.html#normalizeintensity.encodes',
|
|
107
|
+
'fastMONAI/vision_augmentation.py'),
|
|
102
108
|
'fastMONAI.vision_augmentation.OneOf': ( 'vision_augment.html#oneof',
|
|
103
109
|
'fastMONAI/vision_augmentation.py'),
|
|
104
110
|
'fastMONAI.vision_augmentation.OneOf.__init__': ( 'vision_augment.html#oneof.__init__',
|
|
@@ -163,6 +169,12 @@ d = { 'settings': { 'branch': 'master',
|
|
|
163
169
|
'fastMONAI/vision_augmentation.py'),
|
|
164
170
|
'fastMONAI.vision_augmentation.RandomSpike.encodes': ( 'vision_augment.html#randomspike.encodes',
|
|
165
171
|
'fastMONAI/vision_augmentation.py'),
|
|
172
|
+
'fastMONAI.vision_augmentation.RescaleIntensity': ( 'vision_augment.html#rescaleintensity',
|
|
173
|
+
'fastMONAI/vision_augmentation.py'),
|
|
174
|
+
'fastMONAI.vision_augmentation.RescaleIntensity.__init__': ( 'vision_augment.html#rescaleintensity.__init__',
|
|
175
|
+
'fastMONAI/vision_augmentation.py'),
|
|
176
|
+
'fastMONAI.vision_augmentation.RescaleIntensity.encodes': ( 'vision_augment.html#rescaleintensity.encodes',
|
|
177
|
+
'fastMONAI/vision_augmentation.py'),
|
|
166
178
|
'fastMONAI.vision_augmentation.ZNormalization': ( 'vision_augment.html#znormalization',
|
|
167
179
|
'fastMONAI/vision_augmentation.py'),
|
|
168
180
|
'fastMONAI.vision_augmentation.ZNormalization.__init__': ( 'vision_augment.html#znormalization.__init__',
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/03_vision_augment.ipynb.
|
|
2
2
|
|
|
3
3
|
# %% auto 0
|
|
4
|
-
__all__ = ['CustomDictTransform', 'do_pad_or_crop', 'PadOrCrop', 'ZNormalization', '
|
|
5
|
-
'
|
|
6
|
-
'RandomMotion', 'RandomElasticDeformation', 'RandomAffine', 'RandomFlip',
|
|
4
|
+
__all__ = ['CustomDictTransform', 'do_pad_or_crop', 'PadOrCrop', 'ZNormalization', 'RescaleIntensity', 'NormalizeIntensity',
|
|
5
|
+
'BraTSMaskConverter', 'BinaryConverter', 'RandomGhosting', 'RandomSpike', 'RandomNoise', 'RandomBiasField',
|
|
6
|
+
'RandomBlur', 'RandomGamma', 'RandomMotion', 'RandomElasticDeformation', 'RandomAffine', 'RandomFlip',
|
|
7
|
+
'OneOf']
|
|
7
8
|
|
|
8
9
|
# %% ../nbs/03_vision_augment.ipynb 2
|
|
9
10
|
from fastai.data.all import *
|
|
10
11
|
from .vision_core import *
|
|
11
12
|
import torchio as tio
|
|
13
|
+
from monai.transforms import NormalizeIntensity as MonaiNormalizeIntensity
|
|
12
14
|
|
|
13
15
|
# %% ../nbs/03_vision_augment.ipynb 5
|
|
14
16
|
class CustomDictTransform(ItemTransform):
|
|
@@ -84,9 +86,29 @@ class ZNormalization(DisplayedTransform):
|
|
|
84
86
|
self.channel_wise = channel_wise
|
|
85
87
|
|
|
86
88
|
def encodes(self, o: MedImage):
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
try:
|
|
90
|
+
if self.channel_wise:
|
|
91
|
+
o = torch.stack([self.z_normalization(c[None])[0] for c in o])
|
|
92
|
+
else:
|
|
93
|
+
o = self.z_normalization(o)
|
|
94
|
+
except RuntimeError as e:
|
|
95
|
+
if "Standard deviation is 0" in str(e):
|
|
96
|
+
# Calculate mean for debugging information
|
|
97
|
+
mean = float(o.mean())
|
|
98
|
+
|
|
99
|
+
error_msg = (
|
|
100
|
+
f"Standard deviation is 0 for image (mean={mean:.3f}).\n"
|
|
101
|
+
f"This indicates uniform pixel values.\n\n"
|
|
102
|
+
f"Possible causes:\n"
|
|
103
|
+
f"• Corrupted or blank image\n"
|
|
104
|
+
f"• Oversaturated regions\n"
|
|
105
|
+
f"• Background-only regions\n"
|
|
106
|
+
f"• All-zero mask being processed as image\n\n"
|
|
107
|
+
f"Suggested solutions:\n"
|
|
108
|
+
f"• Check image quality and acquisition\n"
|
|
109
|
+
f"• Verify image vs mask data loading"
|
|
110
|
+
)
|
|
111
|
+
raise RuntimeError(error_msg) from e
|
|
90
112
|
|
|
91
113
|
return MedImage.create(o)
|
|
92
114
|
|
|
@@ -94,6 +116,68 @@ class ZNormalization(DisplayedTransform):
|
|
|
94
116
|
return o
|
|
95
117
|
|
|
96
118
|
# %% ../nbs/03_vision_augment.ipynb 10
|
|
119
|
+
class RescaleIntensity(DisplayedTransform):
|
|
120
|
+
"""Apply TorchIO RescaleIntensity for robust intensity scaling.
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
out_min_max (tuple[float, float]): Output intensity range (min, max)
|
|
124
|
+
in_min_max (tuple[float, float]): Input intensity range (min, max)
|
|
125
|
+
|
|
126
|
+
Example for CT images:
|
|
127
|
+
# Normalize CT from air (-1000 HU) to bone (1000 HU) into range (-1, 1)
|
|
128
|
+
transform = RescaleIntensity(out_min_max=(-1, 1), in_min_max=(-1000, 1000))
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
order = 0
|
|
132
|
+
|
|
133
|
+
def __init__(self, out_min_max: tuple[float, float], in_min_max: tuple[float, float]):
|
|
134
|
+
self.rescale = tio.RescaleIntensity(out_min_max=out_min_max, in_min_max=in_min_max)
|
|
135
|
+
|
|
136
|
+
def encodes(self, o: MedImage):
|
|
137
|
+
return MedImage.create(self.rescale(o))
|
|
138
|
+
|
|
139
|
+
def encodes(self, o: MedMask):
|
|
140
|
+
return o
|
|
141
|
+
|
|
142
|
+
# %% ../nbs/03_vision_augment.ipynb 11
|
|
143
|
+
class NormalizeIntensity(DisplayedTransform):
|
|
144
|
+
"""Apply MONAI NormalizeIntensity.
|
|
145
|
+
|
|
146
|
+
Args:
|
|
147
|
+
nonzero (bool): Only normalize non-zero values (default: True)
|
|
148
|
+
channel_wise (bool): Apply normalization per channel (default: True)
|
|
149
|
+
subtrahend (float, optional): Value to subtract
|
|
150
|
+
divisor (float, optional): Value to divide by
|
|
151
|
+
"""
|
|
152
|
+
|
|
153
|
+
order = 0
|
|
154
|
+
|
|
155
|
+
def __init__(self, nonzero: bool = True, channel_wise: bool = True,
|
|
156
|
+
subtrahend: float = None, divisor: float = None):
|
|
157
|
+
self.nonzero = nonzero
|
|
158
|
+
self.channel_wise = channel_wise
|
|
159
|
+
self.subtrahend = subtrahend
|
|
160
|
+
self.divisor = divisor
|
|
161
|
+
|
|
162
|
+
self.transform = MonaiNormalizeIntensity(
|
|
163
|
+
nonzero=nonzero,
|
|
164
|
+
channel_wise=False, # Always 'False', we handle channel-wise manually
|
|
165
|
+
subtrahend=subtrahend,
|
|
166
|
+
divisor=divisor
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
def encodes(self, o: MedImage):
|
|
170
|
+
if self.channel_wise:
|
|
171
|
+
result = torch.stack([self.transform(c[None])[0] for c in o])
|
|
172
|
+
else:
|
|
173
|
+
result = torch.Tensor(self.transform(o))
|
|
174
|
+
|
|
175
|
+
return MedImage.create(result)
|
|
176
|
+
|
|
177
|
+
def encodes(self, o: MedMask):
|
|
178
|
+
return o
|
|
179
|
+
|
|
180
|
+
# %% ../nbs/03_vision_augment.ipynb 12
|
|
97
181
|
class BraTSMaskConverter(DisplayedTransform):
|
|
98
182
|
'''Convert BraTS masks.'''
|
|
99
183
|
|
|
@@ -105,7 +189,7 @@ class BraTSMaskConverter(DisplayedTransform):
|
|
|
105
189
|
o = torch.where(o==4, 3., o)
|
|
106
190
|
return MedMask.create(o)
|
|
107
191
|
|
|
108
|
-
# %% ../nbs/03_vision_augment.ipynb
|
|
192
|
+
# %% ../nbs/03_vision_augment.ipynb 13
|
|
109
193
|
class BinaryConverter(DisplayedTransform):
|
|
110
194
|
'''Convert to binary mask.'''
|
|
111
195
|
|
|
@@ -118,7 +202,7 @@ class BinaryConverter(DisplayedTransform):
|
|
|
118
202
|
o = torch.where(o>0, 1., 0)
|
|
119
203
|
return MedMask.create(o)
|
|
120
204
|
|
|
121
|
-
# %% ../nbs/03_vision_augment.ipynb
|
|
205
|
+
# %% ../nbs/03_vision_augment.ipynb 14
|
|
122
206
|
class RandomGhosting(DisplayedTransform):
|
|
123
207
|
"""Apply TorchIO `RandomGhosting`."""
|
|
124
208
|
|
|
@@ -133,7 +217,7 @@ class RandomGhosting(DisplayedTransform):
|
|
|
133
217
|
def encodes(self, o: MedMask):
|
|
134
218
|
return o
|
|
135
219
|
|
|
136
|
-
# %% ../nbs/03_vision_augment.ipynb
|
|
220
|
+
# %% ../nbs/03_vision_augment.ipynb 15
|
|
137
221
|
class RandomSpike(DisplayedTransform):
|
|
138
222
|
'''Apply TorchIO `RandomSpike`.'''
|
|
139
223
|
|
|
@@ -148,7 +232,7 @@ class RandomSpike(DisplayedTransform):
|
|
|
148
232
|
def encodes(self, o:MedMask):
|
|
149
233
|
return o
|
|
150
234
|
|
|
151
|
-
# %% ../nbs/03_vision_augment.ipynb
|
|
235
|
+
# %% ../nbs/03_vision_augment.ipynb 16
|
|
152
236
|
class RandomNoise(DisplayedTransform):
|
|
153
237
|
'''Apply TorchIO `RandomNoise`.'''
|
|
154
238
|
|
|
@@ -163,7 +247,7 @@ class RandomNoise(DisplayedTransform):
|
|
|
163
247
|
def encodes(self, o: MedMask):
|
|
164
248
|
return o
|
|
165
249
|
|
|
166
|
-
# %% ../nbs/03_vision_augment.ipynb
|
|
250
|
+
# %% ../nbs/03_vision_augment.ipynb 17
|
|
167
251
|
class RandomBiasField(DisplayedTransform):
|
|
168
252
|
'''Apply TorchIO `RandomBiasField`.'''
|
|
169
253
|
|
|
@@ -178,7 +262,7 @@ class RandomBiasField(DisplayedTransform):
|
|
|
178
262
|
def encodes(self, o: MedMask):
|
|
179
263
|
return o
|
|
180
264
|
|
|
181
|
-
# %% ../nbs/03_vision_augment.ipynb
|
|
265
|
+
# %% ../nbs/03_vision_augment.ipynb 18
|
|
182
266
|
class RandomBlur(DisplayedTransform):
|
|
183
267
|
'''Apply TorchIO `RandomBiasField`.'''
|
|
184
268
|
|
|
@@ -193,7 +277,7 @@ class RandomBlur(DisplayedTransform):
|
|
|
193
277
|
def encodes(self, o: MedMask):
|
|
194
278
|
return o
|
|
195
279
|
|
|
196
|
-
# %% ../nbs/03_vision_augment.ipynb
|
|
280
|
+
# %% ../nbs/03_vision_augment.ipynb 19
|
|
197
281
|
class RandomGamma(DisplayedTransform):
|
|
198
282
|
'''Apply TorchIO `RandomGamma`.'''
|
|
199
283
|
|
|
@@ -209,7 +293,7 @@ class RandomGamma(DisplayedTransform):
|
|
|
209
293
|
def encodes(self, o: MedMask):
|
|
210
294
|
return o
|
|
211
295
|
|
|
212
|
-
# %% ../nbs/03_vision_augment.ipynb
|
|
296
|
+
# %% ../nbs/03_vision_augment.ipynb 20
|
|
213
297
|
class RandomMotion(DisplayedTransform):
|
|
214
298
|
"""Apply TorchIO `RandomMotion`."""
|
|
215
299
|
|
|
@@ -237,7 +321,7 @@ class RandomMotion(DisplayedTransform):
|
|
|
237
321
|
def encodes(self, o: MedMask):
|
|
238
322
|
return o
|
|
239
323
|
|
|
240
|
-
# %% ../nbs/03_vision_augment.ipynb
|
|
324
|
+
# %% ../nbs/03_vision_augment.ipynb 22
|
|
241
325
|
class RandomElasticDeformation(CustomDictTransform):
|
|
242
326
|
"""Apply TorchIO `RandomElasticDeformation`."""
|
|
243
327
|
|
|
@@ -250,7 +334,7 @@ class RandomElasticDeformation(CustomDictTransform):
|
|
|
250
334
|
image_interpolation=image_interpolation,
|
|
251
335
|
p=p))
|
|
252
336
|
|
|
253
|
-
# %% ../nbs/03_vision_augment.ipynb
|
|
337
|
+
# %% ../nbs/03_vision_augment.ipynb 23
|
|
254
338
|
class RandomAffine(CustomDictTransform):
|
|
255
339
|
"""Apply TorchIO `RandomAffine`."""
|
|
256
340
|
|
|
@@ -266,14 +350,14 @@ class RandomAffine(CustomDictTransform):
|
|
|
266
350
|
default_pad_value=default_pad_value,
|
|
267
351
|
p=p))
|
|
268
352
|
|
|
269
|
-
# %% ../nbs/03_vision_augment.ipynb
|
|
353
|
+
# %% ../nbs/03_vision_augment.ipynb 24
|
|
270
354
|
class RandomFlip(CustomDictTransform):
|
|
271
355
|
"""Apply TorchIO `RandomFlip`."""
|
|
272
356
|
|
|
273
357
|
def __init__(self, axes='LR', p=0.5):
|
|
274
358
|
super().__init__(tio.RandomFlip(axes=axes, flip_probability=p))
|
|
275
359
|
|
|
276
|
-
# %% ../nbs/03_vision_augment.ipynb
|
|
360
|
+
# %% ../nbs/03_vision_augment.ipynb 25
|
|
277
361
|
class OneOf(CustomDictTransform):
|
|
278
362
|
"""Apply only one of the given transforms using TorchIO `OneOf`."""
|
|
279
363
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastMONAI
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: fastMONAI library
|
|
5
5
|
Home-page: https://github.com/MMIV-ML/fastMONAI
|
|
6
6
|
Author: Satheshkumar Kaliyugarasan
|
|
@@ -53,7 +53,7 @@ Dynamic: summary
|
|
|
53
53
|
|
|
54
54
|
<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
|
|
55
55
|
|
|
56
|
-

|
|
57
57
|
|
|
58
58
|

|
|
59
59
|
[](https://fastmonai.no)
|
|
@@ -120,15 +120,15 @@ https://fastmonai.no for more information.
|
|
|
120
120
|
|
|
121
121
|
| Notebook | 1-Click Notebook |
|
|
122
122
|
|:---|----|
|
|
123
|
-
| [10a_tutorial_classification.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/
|
|
124
|
-
| [10b_tutorial_regression.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/
|
|
125
|
-
| [10c_tutorial_binary_segmentation.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/
|
|
126
|
-
| [10d_tutorial_multiclass_segmentation.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/
|
|
123
|
+
| [10a_tutorial_classification.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/main/nbs/10a_tutorial_classification.ipynb) <br>shows how to construct a binary classification model based on MRI data. | [](https://colab.research.google.com/github/MMIV-ML/fastMONAI/blob/main/nbs/10a_tutorial_classification.ipynb) |
|
|
124
|
+
| [10b_tutorial_regression.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/main/nbs/10b_tutorial_regression.ipynb) <br>shows how to construct a model to predict the age of a subject from MRI scans (“brain age”). | [](https://colab.research.google.com/github/MMIV-ML/fastMONAI/blob/main/nbs/10b_tutorial_regression.ipynb) |
|
|
125
|
+
| [10c_tutorial_binary_segmentation.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/main/nbs/10c_tutorial_binary_segmentation.ipynb) <br>shows how to do binary segmentation (extract the left atrium from monomodal cardiac MRI). | [](https://colab.research.google.com/github/MMIV-ML/fastMONAI/blob/main/nbs/10c_tutorial_binary_segmentation.ipynb) |
|
|
126
|
+
| [10d_tutorial_multiclass_segmentation.ipynb](https://nbviewer.org/github/MMIV-ML/fastMONAI/blob/main/nbs/10d_tutorial_multiclass_segmentation.ipynb) <br>shows how to perform segmentation from multimodal MRI (brain tumor segmentation). | [](https://colab.research.google.com/github/MMIV-ML/fastMONAI/blob/main/nbs/10d_tutorial_multiclass_segmentation.ipynb) |
|
|
127
127
|
|
|
128
128
|
# How to contribute
|
|
129
129
|
|
|
130
130
|
We welcome contributions! See
|
|
131
|
-
[CONTRIBUTING.md](https://github.com/MMIV-ML/fastMONAI/blob/
|
|
131
|
+
[CONTRIBUTING.md](https://github.com/MMIV-ML/fastMONAI/blob/main/CONTRIBUTING.md)
|
|
132
132
|
|
|
133
133
|
# Citing fastMONAI
|
|
134
134
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
### Python Library ###
|
|
6
6
|
lib_name = fastMONAI
|
|
7
7
|
min_python = 3.10
|
|
8
|
-
version = 0.5.
|
|
8
|
+
version = 0.5.2
|
|
9
9
|
### OPTIONAL ###
|
|
10
10
|
|
|
11
11
|
requirements = fastai==2.8.3 monai==1.5.0 torchio==0.20.19 xlrd>=1.2.0 scikit-image==0.25.2 imagedata==3.8.4 mlflow==3.3.1 huggingface-hub gdown gradio opencv-python plum-dispatch
|
|
@@ -20,7 +20,7 @@ tst_flags = notest
|
|
|
20
20
|
### Documentation ###
|
|
21
21
|
host = github
|
|
22
22
|
repo = fastMONAI
|
|
23
|
-
branch =
|
|
23
|
+
branch = main
|
|
24
24
|
custom_sidebar = True
|
|
25
25
|
jupyter_hooks = True
|
|
26
26
|
clean_ids = False
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.5.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|