Skip to content

Commit 48a9a4e

Browse files
authored
Merge branch 'main' into swin_unetr_btcv_v1
2 parents 94e4252 + a74ef4c commit 48a9a4e

File tree

151 files changed

+9948
-1565
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+9948
-1565
lines changed

.github/workflows/pep8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
# quick tests for every pull request
55
push:
66
branches:
7-
- master
7+
- main
88
pull_request:
99

1010
jobs:

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,15 @@ tests/testing_data/*Hippocampus*
138138
# Ignore torch saves
139139
*/torch/runs
140140
logs
141+
*/runs
142+
lightning_logs
143+
144+
# ignore automatically created files
145+
*.ts
146+
nohup.out
147+
deepgrow/ignite/_image.nii.gz
148+
*.zip
149+
deployment/bentoml/mednist_classifier_bentoml.py
150+
deployment/ray/mednist_classifier_start.py
151+
*.nii.gz
152+
3d_segmentation/out

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ci:
99

1010
repos:
1111
- repo: https://github.com/pre-commit/pre-commit-hooks
12-
rev: v4.0.1
12+
rev: v4.1.0
1313
hooks:
1414
- id: end-of-file-fixer
1515
- id: trailing-whitespace

2d_classification/mednist_tutorial.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"* Train the model with a PyTorch program\n",
1616
"* Evaluate on test dataset\n",
1717
"\n",
18-
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Project-MONAI/tutorials/blob/master/2d_classification/mednist_tutorial.ipynb)"
18+
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Project-MONAI/tutorials/blob/main/2d_classification/mednist_tutorial.ipynb)"
1919
]
2020
},
2121
{
@@ -180,7 +180,7 @@
180180
},
181181
"outputs": [],
182182
"source": [
183-
"resource = \"https://drive.google.com/uc?id=1QsnnkvZyJPcbRoV_ArW8SnE1OTuoVbKE\"\n",
183+
"resource = \"https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/MedNIST.tar.gz\"\n",
184184
"md5 = \"0bc7306e7427e00ad1c5526a6677552d\"\n",
185185
"\n",
186186
"compressed_file = os.path.join(root_dir, \"MedNIST.tar.gz\")\n",
@@ -1328,7 +1328,7 @@
13281328
],
13291329
"metadata": {
13301330
"kernelspec": {
1331-
"display_name": "Python 3 (ipykernel)",
1331+
"display_name": "Python 3",
13321332
"language": "python",
13331333
"name": "python3"
13341334
},
@@ -1342,7 +1342,7 @@
13421342
"name": "python",
13431343
"nbconvert_exporter": "python",
13441344
"pygments_lexer": "ipython3",
1345-
"version": "3.8.12"
1345+
"version": "3.7.10"
13461346
}
13471347
},
13481348
"nbformat": 4,

2d_registration/registration_mednist.ipynb

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"- a UNet-like registration network with an affine head to predict the affine transformation parameters;\n",
1414
"- a warp function, implemented as a MONAI C++/CUDA module, to transform the moving image.\n",
1515
"\n",
16-
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Project-MONAI/tutorials/blob/master/2d_registration/registration_mednist.ipynb)"
16+
"[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Project-MONAI/tutorials/blob/main/2d_registration/registration_mednist.ipynb)"
1717
]
1818
},
1919
{
@@ -119,12 +119,36 @@
119119
"import torch\n",
120120
"from torch.nn import MSELoss\n",
121121
"import matplotlib.pyplot as plt\n",
122+
"import os\n",
123+
"import tempfile\n",
122124
"\n",
123125
"\n",
124126
"print_config()\n",
125127
"set_determinism(42)"
126128
]
127129
},
130+
{
131+
"cell_type": "markdown",
132+
"metadata": {},
133+
"source": [
134+
"## Setup data directory\n",
135+
"\n",
136+
"You can specify a directory with the `MONAI_DATA_DIRECTORY` environment variable. \n",
137+
"This allows you to save results and reuse downloads. \n",
138+
"If not specified a temporary directory will be used."
139+
]
140+
},
141+
{
142+
"cell_type": "code",
143+
"execution_count": null,
144+
"metadata": {},
145+
"outputs": [],
146+
"source": [
147+
"directory = os.environ.get(\"MONAI_DATA_DIRECTORY\")\n",
148+
"root_dir = tempfile.mkdtemp() if directory is None else directory\n",
149+
"print(root_dir)"
150+
]
151+
},
128152
{
129153
"cell_type": "markdown",
130154
"metadata": {
@@ -188,7 +212,7 @@
188212
}
189213
],
190214
"source": [
191-
"train_data = MedNISTDataset(root_dir=\"./\", section=\"training\", download=True, transform=None)\n",
215+
"train_data = MedNISTDataset(root_dir=root_dir, section=\"training\", download=True, transform=None)\n",
192216
"training_datadict = [\n",
193217
" {\"fixed_hand\": item[\"image\"], \"moving_hand\": item[\"image\"]}\n",
194218
" for item in train_data.data if item[\"label\"] == 4 # label 4 is for xray hands\n",

0 commit comments

Comments
 (0)