Skip to content

Commit 0a71b98

Browse files
authored
Update tutorial | deepedit deepgrow monailabel (Project-MONAI#1174)
Update some information according to latest contribution guide. Signed-off-by: tangy5 <[email protected]>
1 parent c60dc6d commit 0a71b98

16 files changed

+265
-91
lines changed

deepedit/ignite/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) MONAI Consortium
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.

deepedit/ignite/infoANDinference.ipynb

Lines changed: 32 additions & 35 deletions
Large diffs are not rendered by default.

deepgrow/ignite/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) MONAI Consortium
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.

deepgrow/ignite/inference.ipynb

Lines changed: 62 additions & 19 deletions
Large diffs are not rendered by default.

deepgrow/ignite/inference_3d.ipynb

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
{
22
"cells": [
3+
{
4+
"attachments": {},
5+
"cell_type": "markdown",
6+
"metadata": {},
7+
"source": [
8+
"Copyright (c) MONAI Consortium \n",
9+
"Licensed under the Apache License, Version 2.0 (the \"License\"); \n",
10+
"you may not use this file except in compliance with the License. \n",
11+
"You may obtain a copy of the License at \n",
12+
"&nbsp;&nbsp;&nbsp;&nbsp;http://www.apache.org/licenses/LICENSE-2.0 \n",
13+
"Unless required by applicable law or agreed to in writing, software \n",
14+
"distributed under the License is distributed on an \"AS IS\" BASIS, \n",
15+
"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n",
16+
"See the License for the specific language governing permissions and \n",
17+
"limitations under the License. "
18+
]
19+
},
20+
{
21+
"attachments": {},
22+
"cell_type": "markdown",
23+
"metadata": {},
24+
"source": [
25+
"## Setup environment"
26+
]
27+
},
328
{
429
"cell_type": "code",
530
"execution_count": null,
@@ -9,6 +34,14 @@
934
"!python -c \"import monai\" || pip install -q \"monai-weekly[nibabel, tqdm]\""
1035
]
1136
},
37+
{
38+
"attachments": {},
39+
"cell_type": "markdown",
40+
"metadata": {},
41+
"source": [
42+
"## Setup imports"
43+
]
44+
},
1245
{
1346
"cell_type": "code",
1447
"execution_count": null,
@@ -20,6 +53,7 @@
2053
"import numpy as np\n",
2154
"import torch\n",
2255
"from torch import jit\n",
56+
"from monai.config import print_config\n",
2357
"\n",
2458
"import monai\n",
2559
"from monai.apps.deepgrow.transforms import (\n",
@@ -41,7 +75,15 @@
4175
" AsDiscreted,\n",
4276
" Resized\n",
4377
")\n",
44-
"\n",
78+
"print_config()"
79+
]
80+
},
81+
{
82+
"cell_type": "code",
83+
"execution_count": null,
84+
"metadata": {},
85+
"outputs": [],
86+
"source": [
4587
"max_epochs = 1\n",
4688
"\n",
4789
"\n",
@@ -291,7 +333,7 @@
291333
],
292334
"metadata": {
293335
"kernelspec": {
294-
"display_name": "Python 3 (ipykernel)",
336+
"display_name": "Python 3",
295337
"language": "python",
296338
"name": "python3"
297339
},
@@ -305,7 +347,12 @@
305347
"name": "python",
306348
"nbconvert_exporter": "python",
307349
"pygments_lexer": "ipython3",
308-
"version": "3.8.12"
350+
"version": "3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]"
351+
},
352+
"vscode": {
353+
"interpreter": {
354+
"hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1"
355+
}
309356
}
310357
},
311358
"nbformat": 4,

deepgrow/ignite/prepare_dataset.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# Copyright (c) MONAI Consortium
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.
11+
112
import argparse
213
import distutils.util
314
import json

deepgrow/ignite/train.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# Copyright (c) MONAI Consortium
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.
11+
112
import argparse
213
import distutils.util
314
import json

deepgrow/ignite/train_3d.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# Copyright (c) MONAI Consortium
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.
11+
112
import argparse
213
import distutils.util
314
import logging

deepgrow/ignite/validate.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# Copyright (c) MONAI Consortium
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.
11+
112
import argparse
213
import distutils.util
314
import json

deepgrow/ignite/validate_3d.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# Copyright (c) MONAI Consortium
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.
11+
112
import argparse
213
import distutils.util
314
import logging

monailabel/monailabel_HelloWorld_radiology_3dslicer.ipynb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"Licensed under the Apache License, Version 2.0 (the \"License\"); \n",
99
"you may not use this file except in compliance with the License. \n",
1010
"You may obtain a copy of the License at \n",
11-
" http://www.apache.org/licenses/LICENSE-2.0 \n",
11+
"&nbsp;&nbsp;&nbsp;&nbsp;http://www.apache.org/licenses/LICENSE-2.0 \n",
1212
"Unless required by applicable law or agreed to in writing, software \n",
1313
"distributed under the License is distributed on an \"AS IS\" BASIS, \n",
1414
"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n",
@@ -22,17 +22,18 @@
2222
"In this notebook, we provide a hello world example of MONAI Label use case. Using Spleen segmentation in Radiology app as the demonstration, 3D Slicer as the client viewer, we show how MONAI Label workflow serves as interacitve AI-Assisted tool for labeling CT scans. \n",
2323
"\n",
2424
"![workflow](./figures/monailabel_radiology_3dslicer/teaser_img.png)\n",
25-
"\n"
25+
"\n",
26+
"## 1. Prepare MONAI Label\n"
2627
]
2728
},
2829
{
2930
"cell_type": "markdown",
3031
"metadata": {},
3132
"source": [
32-
"## 1. Prepare MONAI Label\n",
33+
"## Setup environment\n",
3334
"\n",
3435
"### Prerequisites\n",
35-
"- **Install MONAI Label** weekly preview release: \n"
36+
"- **Install MONAI Label** weekly preview release: "
3637
]
3738
},
3839
{
@@ -240,7 +241,7 @@
240241
"name": "python",
241242
"nbconvert_exporter": "python",
242243
"pygments_lexer": "ipython3",
243-
"version": "3.8.10"
244+
"version": "3.9.12"
244245
},
245246
"vscode": {
246247
"interpreter": {

monailabel/monailabel_endoscopy_cvat_tooltracking.ipynb

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"Licensed under the Apache License, Version 2.0 (the \"License\"); \n",
99
"you may not use this file except in compliance with the License. \n",
1010
"You may obtain a copy of the License at \n",
11-
" http://www.apache.org/licenses/LICENSE-2.0 \n",
11+
"&nbsp;&nbsp;&nbsp;&nbsp;http://www.apache.org/licenses/LICENSE-2.0 \n",
1212
"Unless required by applicable law or agreed to in writing, software \n",
1313
"distributed under the License is distributed on an \"AS IS\" BASIS, \n",
1414
"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n",
@@ -28,14 +28,16 @@
2828
"\n",
2929
"In this tutorial, we provide publicly available sample data for demonstration. We highlight the active learning and continuous learning process with MONAI Label + Endoscopic integration.\n",
3030
"\n",
31-
"![cvat](./figures/monailabel_endoscopy_cvat/cvat.png)\n"
31+
"![cvat](./figures/monailabel_endoscopy_cvat/cvat.png)\n",
32+
"\n",
33+
"## 1. Prepare MONAI Label\n"
3234
]
3335
},
3436
{
3537
"cell_type": "markdown",
3638
"metadata": {},
3739
"source": [
38-
"## 1. Prepare MONAI Label\n",
40+
"## Setup environment\n",
3941
"\n",
4042
"### Prerequisites\n",
4143
"- **Install MONAI Label** weekly preview release: "
@@ -169,7 +171,15 @@
169171
"```bash\n",
170172
"# make a working folder in local machine, name workspace\n",
171173
"mkdir workspace\n",
172-
"# Get CVAT plugin folder from the Github\n",
174+
"\n",
175+
"# 1: If in Toolkit, users can get CVAT plugin folder from the toolkit docker\n",
176+
"docker cp $(docker container ls | grep 'nvcr.io/nvidia/clara/monai-toolkit' | awk '{print $1}'):/opt/conda/monailabel/plugins/cvat workspace\n",
177+
"# Deploy all endoscopy models\n",
178+
"./workspace/cvat/deploy.sh endoscopy\n",
179+
"# Or to deploy specific function and model, e.g., tooltracking\n",
180+
"./workspace/cvat/deploy.sh endoscopy tooltracking\n",
181+
"\n",
182+
"# 2 : If MONAI Label is used in local and acquired from Github, get latest CVAT plugin folder from the Github\n",
173183
"git clone https://github.com/Project-MONAI/MONAILabel.git\n",
174184
"# Deploy all endoscopy models\n",
175185
"./MONAILabel/plugins/cvat/deploy.sh endoscopy\n",

monailabel/monailabel_monaibundle_3dslicer_multiorgan_seg.ipynb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"Licensed under the Apache License, Version 2.0 (the \"License\"); \n",
99
"you may not use this file except in compliance with the License. \n",
1010
"You may obtain a copy of the License at \n",
11-
" http://www.apache.org/licenses/LICENSE-2.0 \n",
11+
"&nbsp;&nbsp;&nbsp;&nbsp;http://www.apache.org/licenses/LICENSE-2.0 \n",
1212
"Unless required by applicable law or agreed to in writing, software \n",
1313
"distributed under the License is distributed on an \"AS IS\" BASIS, \n",
1414
"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n",
@@ -48,14 +48,14 @@
4848
"\n",
4949
"![workflow](./figures/monailabel_monaibundle_3dslicer/multi_organ_seg_slicer.png)\n",
5050
"\n",
51-
"\n"
51+
"## 1. Prepare MONAI Label\n"
5252
]
5353
},
5454
{
5555
"cell_type": "markdown",
5656
"metadata": {},
5757
"source": [
58-
"## 1. Prepare MONAI Label\n",
58+
"## Setup environment\n",
5959
"\n",
6060
"### Prerequisites\n",
6161
"- **Install MONAI Label** weekly preview release: \n"
@@ -125,7 +125,6 @@
125125
"metadata": {},
126126
"outputs": [],
127127
"source": [
128-
"!export BUNDLE_DOWNLOAD_SRC=ngc\n",
129128
"!monailabel start_server --app apps/monaibundle --studies datasets/Task09_Spleen/imagesTr --conf models swin_unetr_btcv_segmentation --conf auth_token <YOUR AUTH TOKEN>"
130129
]
131130
},

monailabel/monailabel_pancreas_tumor_segmentation_3DSlicer.ipynb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
22
"cells": [
33
{
4+
"attachments": {},
45
"cell_type": "markdown",
56
"metadata": {},
67
"source": [
78
"Copyright (c) MONAI Consortium \n",
89
"Licensed under the Apache License, Version 2.0 (the \"License\"); \n",
910
"you may not use this file except in compliance with the License. \n",
1011
"You may obtain a copy of the License at \n",
11-
" http://www.apache.org/licenses/LICENSE-2.0 \n",
12+
"&nbsp;&nbsp;&nbsp;&nbsp;http://www.apache.org/licenses/LICENSE-2.0 \n",
1213
"Unless required by applicable law or agreed to in writing, software \n",
1314
"distributed under the License is distributed on an \"AS IS\" BASIS, \n",
1415
"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n",
@@ -35,14 +36,16 @@
3536
"\n",
3637
"<p align = \"center\"><img src=\"./figures/monailabel_bring_your_own_data/dints.png\" alt=\"drawing\" width=\"700\"/></p>\n",
3738
"<p align = \"center\">This model is trained using the neural network model from the neural architecture search algorithm, DiNTS.</p>\n",
38-
"\n"
39+
"\n",
40+
"## 1. Prepare MONAI Label and Dataset"
3941
]
4042
},
4143
{
44+
"attachments": {},
4245
"cell_type": "markdown",
4346
"metadata": {},
4447
"source": [
45-
"## 1. Prepare MONAI Label and Dataset\n",
48+
"## Setup environment\n",
4649
"\n",
4750
"### Prerequisites\n",
4851
"- **Install MONAI Label** weekly preview release: "
@@ -235,7 +238,7 @@
235238
"name": "python",
236239
"nbconvert_exporter": "python",
237240
"pygments_lexer": "ipython3",
238-
"version": "3.9.12"
241+
"version": "3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]"
239242
},
240243
"vscode": {
241244
"interpreter": {

monailabel/monailabel_pathology_nuclei_segmentation_QuPath.ipynb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"Licensed under the Apache License, Version 2.0 (the \"License\"); \n",
99
"you may not use this file except in compliance with the License. \n",
1010
"You may obtain a copy of the License at \n",
11-
" http://www.apache.org/licenses/LICENSE-2.0 \n",
11+
"&nbsp;&nbsp;&nbsp;&nbsp;http://www.apache.org/licenses/LICENSE-2.0 \n",
1212
"Unless required by applicable law or agreed to in writing, software \n",
1313
"distributed under the License is distributed on an \"AS IS\" BASIS, \n",
1414
"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. \n",
@@ -22,17 +22,23 @@
2222
"In this notebook, we show the example of MONAI Label Pathology usecase. The nuclei segmentation is demonstrated. This tutorial uses Qupath as the client viewer, and we demonstrate the end-to-end workflow with MONAI Label + QuPath integration.\n",
2323
"\n",
2424
"![qupath1](./figures/monailabel_pathology_qupath/qupath1.png)\n",
25-
"\n"
25+
"\n",
26+
"## 1. Prepare MONAI Label"
2627
]
2728
},
29+
{
30+
"cell_type": "markdown",
31+
"metadata": {},
32+
"source": []
33+
},
2834
{
2935
"cell_type": "markdown",
3036
"metadata": {},
3137
"source": [
32-
"## 1. Prepare MONAI Label\n",
38+
"## Setup environment\n",
3339
"\n",
3440
"### Prerequisites\n",
35-
"- **Install MONAI Label** weekly preview release: \n"
41+
"- **Install MONAI Label** weekly preview release: "
3642
]
3743
},
3844
{

0 commit comments

Comments
 (0)