Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 3d_segmentation/brats_segmentation_3d.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,12 @@
" LoadImaged(keys=[\"image\", \"label\"]),\n",
" EnsureChannelFirstd(keys=\"image\"),\n",
" ConvertToMultiChannelBasedOnBratsClassesd(keys=\"label\"),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" Spacingd(\n",
" keys=[\"image\", \"label\"],\n",
" pixdim=(1.0, 1.0, 1.0),\n",
" mode=(\"bilinear\", \"nearest\"),\n",
" ),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" RandSpatialCropd(keys=[\"image\", \"label\"], roi_size=[224, 224, 144], random_size=False),\n",
" RandFlipd(keys=[\"image\", \"label\"], prob=0.5, spatial_axis=0),\n",
" RandFlipd(keys=[\"image\", \"label\"], prob=0.5, spatial_axis=1),\n",
Expand All @@ -287,12 +287,12 @@
" LoadImaged(keys=[\"image\", \"label\"]),\n",
" EnsureChannelFirstd(keys=\"image\"),\n",
" ConvertToMultiChannelBasedOnBratsClassesd(keys=\"label\"),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" Spacingd(\n",
" keys=[\"image\", \"label\"],\n",
" pixdim=(1.0, 1.0, 1.0),\n",
" mode=(\"bilinear\", \"nearest\"),\n",
" ),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" NormalizeIntensityd(keys=\"image\", nonzero=True, channel_wise=True),\n",
" EnsureTyped(keys=[\"image\", \"label\"]),\n",
" ]\n",
Expand Down Expand Up @@ -784,8 +784,8 @@
" LoadImaged(keys=[\"image\", \"label\"]),\n",
" EnsureChannelFirstd(keys=[\"image\"]),\n",
" ConvertToMultiChannelBasedOnBratsClassesd(keys=\"label\"),\n",
" Spacingd(keys=[\"image\"], pixdim=(1.0, 1.0, 1.0), mode=\"bilinear\"),\n",
" Orientationd(keys=[\"image\"], axcodes=\"RAS\"),\n",
" Spacingd(keys=[\"image\"], pixdim=(1.0, 1.0, 1.0), mode=\"bilinear\"),\n",
" NormalizeIntensityd(keys=\"image\", nonzero=True, channel_wise=True),\n",
" EnsureTyped(keys=[\"image\", \"label\"]),\n",
" ]\n",
Expand Down
12 changes: 6 additions & 6 deletions 3d_segmentation/spleen_segmentation_3d.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@
"Here we use several transforms to augment the dataset:\n",
"1. `LoadImaged` loads the spleen CT images and labels from NIfTI format files.\n",
"1. `AddChanneld` as the original data doesn't have channel dim, add 1 dim to construct \"channel first\" shape.\n",
"1. `Spacingd` adjusts the spacing by `pixdim=(1.5, 1.5, 2.)` based on the affine matrix.\n",
"1. `Orientationd` unifies the data orientation based on the affine matrix.\n",
"1. `Spacingd` adjusts the spacing by `pixdim=(1.5, 1.5, 2.)` based on the affine matrix.\n",
"1. `ScaleIntensityRanged` extracts intensity range [-57, 164] and scales to [0, 1].\n",
"1. `CropForegroundd` removes all zero borders to focus on the valid body area of the images and labels.\n",
"1. `RandCropByPosNegLabeld` randomly crop patch samples from big image based on pos / neg ratio. \n",
Expand All @@ -279,9 +279,9 @@
" [\n",
" LoadImaged(keys=[\"image\", \"label\"]),\n",
" EnsureChannelFirstd(keys=[\"image\", \"label\"]),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" Spacingd(keys=[\"image\", \"label\"], pixdim=(\n",
" 1.5, 1.5, 2.0), mode=(\"bilinear\", \"nearest\")),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" ScaleIntensityRanged(\n",
" keys=[\"image\"], a_min=-57, a_max=164,\n",
" b_min=0.0, b_max=1.0, clip=True,\n",
Expand Down Expand Up @@ -311,9 +311,9 @@
" [\n",
" LoadImaged(keys=[\"image\", \"label\"]),\n",
" EnsureChannelFirstd(keys=[\"image\", \"label\"]),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" Spacingd(keys=[\"image\", \"label\"], pixdim=(\n",
" 1.5, 1.5, 2.0), mode=(\"bilinear\", \"nearest\")),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" ScaleIntensityRanged(\n",
" keys=[\"image\"], a_min=-57, a_max=164,\n",
" b_min=0.0, b_max=1.0, clip=True,\n",
Expand Down Expand Up @@ -692,9 +692,9 @@
" [\n",
" LoadImaged(keys=[\"image\", \"label\"]),\n",
" EnsureChannelFirstd(keys=[\"image\", \"label\"]),\n",
" Orientationd(keys=[\"image\"], axcodes=\"RAS\"),\n",
" Spacingd(keys=[\"image\"], pixdim=(\n",
" 1.5, 1.5, 2.0), mode=\"bilinear\"),\n",
" Orientationd(keys=[\"image\"], axcodes=\"RAS\"),\n",
" ScaleIntensityRanged(\n",
" keys=[\"image\"], a_min=-57, a_max=164,\n",
" b_min=0.0, b_max=1.0, clip=True,\n",
Expand Down Expand Up @@ -785,7 +785,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -799,7 +799,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.7.10"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions 3d_segmentation/spleen_segmentation_3d_lightning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@
" [\n",
" LoadImaged(keys=[\"image\", \"label\"]),\n",
" AddChanneld(keys=[\"image\", \"label\"]),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" Spacingd(\n",
" keys=[\"image\", \"label\"],\n",
" pixdim=(1.5, 1.5, 2.0),\n",
" mode=(\"bilinear\", \"nearest\"),\n",
" ),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" ScaleIntensityRanged(\n",
" keys=[\"image\"], a_min=-57, a_max=164,\n",
" b_min=0.0, b_max=1.0, clip=True,\n",
Expand Down Expand Up @@ -310,12 +310,12 @@
" [\n",
" LoadImaged(keys=[\"image\", \"label\"]),\n",
" AddChanneld(keys=[\"image\", \"label\"]),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" Spacingd(\n",
" keys=[\"image\", \"label\"],\n",
" pixdim=(1.5, 1.5, 2.0),\n",
" mode=(\"bilinear\", \"nearest\"),\n",
" ),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" ScaleIntensityRanged(\n",
" keys=[\"image\"], a_min=-57, a_max=164,\n",
" b_min=0.0, b_max=1.0, clip=True,\n",
Expand Down Expand Up @@ -691,7 +691,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -705,7 +705,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.7.10"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions 3d_segmentation/unetr_btcv_segmentation_3d.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@
" [\n",
" LoadImaged(keys=[\"image\", \"label\"]),\n",
" AddChanneld(keys=[\"image\", \"label\"]),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" Spacingd(\n",
" keys=[\"image\", \"label\"],\n",
" pixdim=(1.5, 1.5, 2.0),\n",
" mode=(\"bilinear\", \"nearest\"),\n",
" ),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" ScaleIntensityRanged(\n",
" keys=[\"image\"],\n",
" a_min=-175,\n",
Expand Down Expand Up @@ -254,12 +254,12 @@
" [\n",
" LoadImaged(keys=[\"image\", \"label\"]),\n",
" AddChanneld(keys=[\"image\", \"label\"]),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" Spacingd(\n",
" keys=[\"image\", \"label\"],\n",
" pixdim=(1.5, 1.5, 2.0),\n",
" mode=(\"bilinear\", \"nearest\"),\n",
" ),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" ScaleIntensityRanged(\n",
" keys=[\"image\"], a_min=-175, a_max=250, b_min=0.0, b_max=1.0, clip=True\n",
" ),\n",
Expand Down Expand Up @@ -833,7 +833,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -847,7 +847,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.7.10"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions 3d_segmentation/unetr_btcv_segmentation_3d_lightning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -444,12 +444,12 @@
" [\n",
" LoadImaged(keys=[\"image\", \"label\"]),\n",
" AddChanneld(keys=[\"image\", \"label\"]),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" Spacingd(\n",
" keys=[\"image\", \"label\"],\n",
" pixdim=(1.5, 1.5, 2.0),\n",
" mode=(\"bilinear\", \"nearest\"),\n",
" ),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" ScaleIntensityRanged(\n",
" keys=[\"image\"],\n",
" a_min=-175,\n",
Expand Down Expand Up @@ -501,12 +501,12 @@
" [\n",
" LoadImaged(keys=[\"image\", \"label\"]),\n",
" AddChanneld(keys=[\"image\", \"label\"]),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" Spacingd(\n",
" keys=[\"image\", \"label\"],\n",
" pixdim=(1.5, 1.5, 2.0),\n",
" mode=(\"bilinear\", \"nearest\"),\n",
" ),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" ScaleIntensityRanged(\n",
" keys=[\"image\"],\n",
" a_min=-175,\n",
Expand Down Expand Up @@ -771,7 +771,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -785,7 +785,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.7.10"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions acceleration/automatic_mixed_precision.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@
" [\n",
" LoadImaged(keys=[\"image\", \"label\"]),\n",
" AddChanneld(keys=[\"image\", \"label\"]),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" Spacingd(\n",
" keys=[\"image\", \"label\"],\n",
" pixdim=(1.5, 1.5, 2.0),\n",
" mode=(\"bilinear\", \"nearest\"),\n",
" ),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" ScaleIntensityRanged(\n",
" keys=[\"image\"],\n",
" a_min=-57,\n",
Expand Down Expand Up @@ -282,12 +282,12 @@
" [\n",
" LoadImaged(keys=[\"image\", \"label\"]),\n",
" AddChanneld(keys=[\"image\", \"label\"]),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" Spacingd(\n",
" keys=[\"image\", \"label\"],\n",
" pixdim=(1.5, 1.5, 2.0),\n",
" mode=(\"bilinear\", \"nearest\"),\n",
" ),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" ScaleIntensityRanged(\n",
" keys=[\"image\"],\n",
" a_min=-57,\n",
Expand Down Expand Up @@ -856,7 +856,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -870,7 +870,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.7.10"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions acceleration/dataset_type_performance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,12 @@
" [\n",
" LoadImaged(keys=[\"image\", \"label\"]),\n",
" AddChanneld(keys=[\"image\", \"label\"]),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" Spacingd(\n",
" keys=[\"image\", \"label\"],\n",
" pixdim=(1.5, 1.5, 2.0),\n",
" mode=(\"bilinear\", \"nearest\"),\n",
" ),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" ScaleIntensityRanged(\n",
" keys=[\"image\"],\n",
" a_min=-57,\n",
Expand Down Expand Up @@ -437,12 +437,12 @@
" [\n",
" LoadImaged(keys=[\"image\", \"label\"]),\n",
" AddChanneld(keys=[\"image\", \"label\"]),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" Spacingd(\n",
" keys=[\"image\", \"label\"],\n",
" pixdim=(1.5, 1.5, 2.0),\n",
" mode=(\"bilinear\", \"nearest\"),\n",
" ),\n",
" Orientationd(keys=[\"image\", \"label\"], axcodes=\"RAS\"),\n",
" ScaleIntensityRanged(\n",
" keys=[\"image\"],\n",
" a_min=-57,\n",
Expand Down Expand Up @@ -739,7 +739,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -753,7 +753,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.7.10"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions acceleration/distributed_training/brats_training_ddp.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ def main_worker(args):
LoadImaged(keys=["image", "label"]),
EnsureChannelFirstd(keys="image"),
ConvertToMultiChannelBasedOnBratsClassesd(keys="label"),
Orientationd(keys=["image", "label"], axcodes="RAS"),
Spacingd(
keys=["image", "label"],
pixdim=(1.0, 1.0, 1.0),
mode=("bilinear", "nearest"),
),
Orientationd(keys=["image", "label"], axcodes="RAS"),
EnsureTyped(keys=["image", "label"]),
ToDeviced(keys=["image", "label"], device=device),
RandSpatialCropd(keys=["image", "label"], roi_size=[224, 224, 144], random_size=False),
Expand Down Expand Up @@ -225,12 +225,12 @@ def main_worker(args):
LoadImaged(keys=["image", "label"]),
EnsureChannelFirstd(keys="image"),
ConvertToMultiChannelBasedOnBratsClassesd(keys="label"),
Orientationd(keys=["image", "label"], axcodes="RAS"),
Spacingd(
keys=["image", "label"],
pixdim=(1.0, 1.0, 1.0),
mode=("bilinear", "nearest"),
),
Orientationd(keys=["image", "label"], axcodes="RAS"),
NormalizeIntensityd(keys="image", nonzero=True, channel_wise=True),
EnsureTyped(keys=["image", "label"]),
ToDeviced(keys=["image", "label"], device=device),
Expand Down
2 changes: 1 addition & 1 deletion acceleration/fast_model_training_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ For example:
train_transforms = [
LoadImaged(...),
AddChanneld(...),
Spacingd(...),
Orientationd(...),
Spacingd(...),
ScaleIntensityRanged(...),
CropForegroundd(...),
FgBgToIndicesd(...),
Expand Down
Loading