Skip to content

Commit 0b0c478

Browse files
authored
Doc changes for addressing issues and for releasing App SDK v0.5 (#373)
* Draft of 0.5 docs Signed-off-by: M Q <[email protected]> * Add doc for DICOM PDF Signed-off-by: M Q <[email protected]> * Fix typo Signed-off-by: M Q <[email protected]> * Added a missing new file and typo corrections Signed-off-by: M Q <[email protected]> * Update requirements for docs (for gen_docs) and typo corrections Signed-off-by: M Q <[email protected]> * Reran clara-viz notebook with just release new clara-viz package 0.2.2 Signed-off-by: M Q <[email protected]> * Release note adds reference to MD Express, and the removal of MIS Signed-off-by: M Q <[email protected]> * Release note adds statement on DICOM date/time/TimezoneOffset Signed-off-by: M Q <[email protected]> * Correct missing optional import found during QA Signed-off-by: M Q <[email protected]> * Final corrections after QA Signed-off-by: M Q <[email protected]> Signed-off-by: M Q <[email protected]>
1 parent 05409d9 commit 0b0c478

29 files changed

+1786
-1812
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,15 @@ YouTube Video:
7979
- [Spleen Organ Segmentation - Jupyter Notebook Tutorial](https://www.youtube.com/watch?v=cqDVxzYt9lY)
8080
- [Spleen Organ Segmentation - Deep Dive](https://www.youtube.com/watch?v=nivgfD4pwWE)
8181

82-
### [4) Deploying Segmentation app with MONAI Inference Service (MIS)](https://docs.monai.io/projects/monai-deploy-app-sdk/en/latest/getting_started/tutorials/04_mis_tutorial.html)
82+
### [4) Creating a Segmentation app](https://docs.monai.io/projects/monai-deploy-app-sdk/en/latest/getting_started/tutorials/03_segmentation_viz_app.html)
8383

84-
### [5) Building and deploying Segmentation app with MONAI Inference Service (MIS)](https://docs.monai.io/projects/monai-deploy-app-sdk/en/latest/getting_started/tutorials/05_full_tutorial.html)
85-
86-
### [6) Creating a Segmentation app consuming a MONAI Bundle](https://docs.monai.io/projects/monai-deploy-app-sdk/en/0.4.0/getting_started/tutorials/06_monai_bundle_app.html)
84+
### [5) Creating a Segmentation app consuming a MONAI Bundle](https://docs.monai.io/projects/monai-deploy-app-sdk/en/latest/getting_started/tutorials/06_monai_bundle_app.html)
8785

8886
### [Examples](https://docs.monai.io/projects/monai-deploy-app-sdk/en/latest/getting_started/examples.html)
8987

9088
<https://github.com/Project-MONAI/monai-deploy-app-sdk/tree/main/examples/apps> has example apps that you can see.
9189

90+
- ai_livertumor_seg_app
9291
- ai_spleen_seg_app
9392
- ai_unetr_seg_app
9493
- dicom_series_to_image_app

docs/requirements.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Sphinx==4.1.2
22
sphinx-autobuild==2021.3.14
33
myst-parser==0.15.2
4-
numpy==1.21.2 # CVE-2021-33430
4+
numpy>=1.21.2 # CVE-2021-33430
55
matplotlib==3.3.4
66
ipywidgets==7.6.4
77
pandas==1.1.5
@@ -22,11 +22,13 @@ scipy
2222
scikit-image>=0.17.2
2323
plotly
2424
nibabel>=3.2.1
25-
monai>=0.9.0
25+
monai>=1.0.0
2626
torch>=1.10.0
2727
numpy-stl>=2.12.0
2828
trimesh>=3.8.11
2929
pydicom
30+
PyPDF2>=2.11.1
31+
highdicom>=0.18.2
3032
sphinx-autodoc-typehints==1.12.0
3133
sphinxcontrib-applehelp==1.0.2
3234
sphinxcontrib-devhelp==1.0.2

docs/source/developing_with_sdk/core_concepts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ graph TD
7878
7979
click Package "./packaging_app.html" "Go to the document" _self
8080
click ExecPackage "./executing_packaged_app_locally.html" "Go to the document" _self
81-
click DeployPackage "./deploying_to_the_remote_server.html" "Go to the document" _self
81+
click DeployPackage "./deploying_and_hosting_map.html" "Go to the document" _self
8282
```
8383
<!-- In the above caption text, it uses Unicode blank characters('⠀⠀') in front of the text to align to center (somehow, it is misaligned little bit) -->
8484

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Deploying and Hosting MONAI App Package
2+
3+
The MONAI Application Package, MAP, built and packaged using MONAI Deploy App SDK, can be deployed in multiple ways, each with different levels of integration with a hosting platform.
4+
- A MAP is an OCI compliant container, albeit requiring <a href="https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/overview.html"> Nvidia Container Toolkit </a> as it is based on the <a href="https://catalog.ngc.nvidia.com/orgs/nvidia/containers/pytorch">Nvidia PyTorch Python container image </a>. The hosting platforms, via their own tooling, can inspect the MAP metadata and ensure dependencies are satisfied on launching the MAP container, for example, an MAP can used in a Argo workflow.
5+
- A MAP runs "natively" on a platform, where the platform specific adaptor or shim embedded in the MAP can understand the MAP and the platform APIs thus manages the life cycle of the application per platform requests. At the onset, the only native execution planned is on the <a href="https://github.com/Project-MONAI/monai-deploy/releases">MONAI Deploy</a>. The support for other platforms is on the horizon.
6+
- As envisioned for the long term, standardization of deployment package specification will be needed, so that compliant application packages shall work on all compliant platforms. One of the initiatives in this area is the <a href="https://oam.dev/">Open Appication Model</a>, though the App SDK project is not yet actively investigating the integration.

docs/source/developing_with_sdk/deploying_to_the_remote_server.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docs/source/developing_with_sdk/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ creating_application_class
1111
executing_app_locally.ipynb
1212
packaging_app
1313
executing_packaged_app_locally
14-
deploying_to_the_remote_server
14+
deploying_and_hosting_map
1515
```

docs/source/developing_with_sdk/packaging_app.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ In this step, the MONAI Deploy application can now be built into a deployable Do
66

77
The MONAI Application Packager (Packager) is a utility for building an application developed with the MONAI Deploy App SDK into a structured MONAI Application Package (**MAP**).
88

9-
The MAP produced by the Packager is a deployable and reusable docker image that can be launched [locally](./executing_packaged_app_locally) or [remotely](./deploying_to_the_remote_server).
9+
The MAP produced by the Packager is a deployable and reusable docker image that can be launched [locally](./executing_packaged_app_locally) or [remotely](./deploying_and_hosting_map).
1010

1111
### Basic Usage of MONAI Application Packager
1212

@@ -67,7 +67,7 @@ Building MONAI Application Package...
6767
Successfully built my_app:latest
6868
```
6969

70-
The MAP image `my_app:latest` will be seen in the list of container images on the user's local machine when the command `docker images` is run. The MAP image `my_app:latest` will be able to run [locally](./executing_packaged_app_locally) or [remotely](./deploying_to_the_remote_server).
70+
The MAP image `my_app:latest` will be seen in the list of container images on the user's local machine when the command `docker images` is run. The MAP image `my_app:latest` will be able to run [locally](./executing_packaged_app_locally) or [remotely](./deploying_and_hosting_map).
7171

7272
```{note}
7373
* The current implementation (as of `0.1.0`) of the Packager **ONLY** supports [**CUDA**](https://ngc.nvidia.com/catalog/containers/nvidia:cuda) and [**Pytorch**](https://ngc.nvidia.com/catalog/containers/nvidia:pytorch) images from `nvcr.io` as base images for the MAP. There are efforts in progress to add support for smaller images from [dockerhub](https://hub.docker.com/).

docs/source/getting_started/tutorials/04_mis_tutorial.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

docs/source/getting_started/tutorials/05_full_tutorial.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

docs/source/getting_started/tutorials/index.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
:glob:
55
:maxdepth: 2
66
7-
01_simple_app
8-
02_mednist_app
9-
03_segmentation_app
10-
04_mis_tutorial
11-
05_full_tutorial
12-
06_monai_bundle_app
7+
simple_app
8+
mednist_app
9+
monai_bundle_app
10+
segmentation_app
11+
segmentation_clara-viz_app
1312
```

docs/source/getting_started/tutorials/02_mednist_app.md renamed to docs/source/getting_started/tutorials/mednist_app.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# 2) Creating MedNIST Classifier app
1+
# Creating MedNIST Classifier App
2+
3+
This tutorial demos the process of packaging up a trained model using MONAI Deploy App SDK into an artifact which can be run as a local program performing inference, a workflow job doing the same, and a Docker containerized workflow execution.
24

35
## Setup
46

docs/source/getting_started/tutorials/06_monai_bundle_app.md renamed to docs/source/getting_started/tutorials/monai_bundle_app.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# 6) Creating a Segmentation app consuming a MONAI Bundle
1+
# Creating a Segmentation App Consuming a MONAI Bundle
2+
3+
This tutorial shows how to create an organ segmentation application for a PyTorch model that has been trained with MONAI and packaged in the [MONAI Bundle](https://docs.monai.io/en/latest/bundle_intro.html) format.
24

35
## Setup
46

@@ -39,20 +41,20 @@ git clone --branch main --depth 1 https://github.com/Project-MONAI/monai-deploy-
3941
cd monai-deploy-app-sdk
4042

4143
# Install monai-deploy-app-sdk package
42-
pip install monai-deploy-app-sdk
44+
pip install --upgrade monai-deploy-app-sdk
4345

4446
# Download/Extract ai_spleen_bundle_data zip file from https://drive.google.com/file/d/1cJq0iQh_yzYIxVElSlVa141aEmHZADJh/view?usp=sharing
4547

46-
# Download ai_spleen_bundle_data.zip
48+
# Download the zip file containing both the model and test data
4749
pip install gdown
48-
gdown https://drive.google.com/uc?id=1cJq0iQh_yzYIxVElSlVa141aEmHZADJh
50+
gdown https://drive.google.com/uc?id=1Uds8mEvdGNYUuvFpTtCQ8gNU97bAPCaQ
4951

50-
# After downloading ai_spleen_bundle_data.zip from the web browser or using gdown,
51-
unzip -o ai_spleen_bundle_data.zip
52+
# After downloading it using gdown, unzip the zip file saved by gdown
53+
unzip -o ai_spleen_seg_bundle_data.zip
5254

5355
# Install necessary packages from the app; note that numpy-stl and trimesh are only
5456
# needed if the application uses the STL Conversion Operator
55-
pip install monai pydicom SimpleITK Pillow nibabel scikit-image numpy-stl trimesh
57+
pip install monai torch pydicom highdicom SimpleITK Pillow nibabel scikit-image numpy-stl trimesh
5658

5759
# Local execution of the app directly or using MONAI Deploy CLI
5860
python examples/apps/ai_spleen_seg_app/app.py -i dcm/ -o output -m model.ts

docs/source/getting_started/tutorials/03_segmentation_app.md renamed to docs/source/getting_started/tutorials/segmentation_app.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# 3) Creating a Segmentation app
1+
# Creating a Segmentation App
2+
3+
This tutorial shows how to create an organ segmentation application for a PyTorch model that has been trained with MONAI. Please note that the example code used in the Jupyter Notebook is based on an earlier version of the segmentation application, i.e., not using MONAI Bundle Inference Operator, and the code is not necessarily the same as the latest source code on Github.
24

35
## Setup
46

@@ -15,7 +17,7 @@ jupyter-lab
1517
```
1618

1719
## Executing from Jupyter Notebook
18-
Please note that the example code used in the Jupyter Notebook is based on an earlier version of the segmentation application, hence not the same as the latest source code on Github, e.g. not using MONAI Bundle inference operator.
20+
1921
```{toctree}
2022
:maxdepth: 4
2123
@@ -51,20 +53,20 @@ git clone --branch main --depth 1 https://github.com/Project-MONAI/monai-deploy-
5153
cd monai-deploy-app-sdk
5254

5355
# Install monai-deploy-app-sdk package
54-
pip install monai-deploy-app-sdk
56+
pip install --upgrade monai-deploy-app-sdk
5557

5658
# Download/Extract ai_spleen_bundle_data zip file from https://drive.google.com/file/d/1cJq0iQh_yzYIxVElSlVa141aEmHZADJh/view?usp=sharing
5759

58-
# Download ai_spleen_bundle_data.zip
60+
# Download the zip file containing both the model and test data
5961
pip install gdown
60-
gdown https://drive.google.com/uc?id=1cJq0iQh_yzYIxVElSlVa141aEmHZADJh
62+
gdown https://drive.google.com/uc?id=1Uds8mEvdGNYUuvFpTtCQ8gNU97bAPCaQ
6163

62-
# After downloading ai_spleen_bundle_data.zip from the web browser or using gdown,
63-
unzip -o ai_spleen_bundle_data.zip
64+
# After downloading it using gdown, unzip the zip file saved by gdown
65+
unzip -o ai_spleen_seg_bundle_data.zip
6466

6567
# Install necessary packages from the app; note that numpy-stl and trimesh are only
6668
# needed if the application uses the STL Conversion Operator
67-
pip install monai pydicom SimpleITK Pillow nibabel scikit-image numpy-stl trimesh
69+
pip install monai pydicom highdicom SimpleITK Pillow nibabel scikit-image numpy-stl trimesh
6870

6971
# Local execution of the app
7072
python examples/apps/ai_spleen_seg_app/app.py -i dcm/ -o output -m model.ts
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Creating a Segmentation App Including Including Visualization with Clara-Viz
2+
3+
This tutorial shows how to create an organ segmentation application for a PyTorch model that has been trained with MONAI, and visualize the segmentation and input images with Clara Viz integration.
4+
5+
## Setup
6+
7+
```bash
8+
# Create a virtual environment with Python 3.7.
9+
# Skip if you are already in a virtual environment.
10+
# (JupyterLab dropped its support for Python 3.6 since 2021-12-23.
11+
# See https://github.com/jupyterlab/jupyterlab/pull/11740)
12+
conda create -n monai python=3.7 pytorch torchvision jupyterlab cudatoolkit=11.1 -c pytorch -c conda-forge
13+
conda activate monai
14+
15+
# Launch JupyterLab if you want to work on Jupyter Notebook
16+
jupyter-lab
17+
```
18+
19+
## Executing from Jupyter Notebook
20+
21+
```{toctree}
22+
:maxdepth: 4
23+
24+
../../notebooks/tutorials/03_segmentation_viz_app.ipynb
25+
```
26+
27+
```{raw} html
28+
<p style="text-align: center;">
29+
<a class="sphinx-bs btn text-wrap btn-outline-primary col-md-6 reference external" href="../../_static/notebooks/tutorials/03_segmentation_viz_app.ipynb">
30+
<span>Download 03_segmentation_viz_app.ipynb</span>
31+
</a>
32+
</p>
33+
```

docs/source/getting_started/tutorials/01_simple_app.md renamed to docs/source/getting_started/tutorials/simple_app.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# 1) Creating a simple image processing app
1+
# Creating a simple image processing app
2+
3+
This tutorial shows how to develop a simple image processing application can be created with MONAI Deploy App SDK.
24

35
## Setup
46

docs/source/introduction/overview.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,17 @@ It contains the following elements:
99
- A mechanism to locally run a MAP via App Runner
1010
- A set of sample applications
1111
- API documentation
12+
13+
To further accelerate the development of medical imaging AI inference application with DICOM imaging network integration, a set of domain specific functionalities are provided by this Application SDK,
14+
- generic application classes to automate the inference with MONAI Bundle
15+
- DICOM study parsing and selection classes, as well as DICOM instance to volume image conversion
16+
- DICOM instance writers to encapsulate AI inference results in these DICOM OID,
17+
- DICOM Segmentation
18+
- DICOM Basic Text Structured Report
19+
- DICOM Encapsulated PDF
20+
- more are coming
21+
22+
:::{note}
23+
- The software and the imaging AI results generated are for research use only, and per applicable laws and regulations, are not for clinical use.
24+
- The App SDK, and specifically the DICOM instance writers, rely upon the underlying operating system to provide accurate and consistent time, though have no direct control over how the OS performs time synchronization, e.g. NTP on Ubuntu. For creation of DICOM or HL7 objects that use time, the built-in classes do, and it would also be incumbent on the developer to appropriately use the available system time service and reflect the correct time in those objects properly. Additionally, the DICOM instance generated by the App SDK built-in classes set the <a href="https://dicom.nema.org/medical/dicom/2020b/output/chtml/part03/sect_C.12.5.html">Timezone Offset From UTC</a> with the underlying operating system's timezone setting.
25+
:::

docs/source/introduction/roadmap.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Roadmap
22

3-
The first version of the MONAI Deploy App SDK offers a core framework to build & package healthcare AI apps so that they can be deployed to a production environment
3+
The first versions of the MONAI Deploy App SDK offer a core framework to build & package healthcare AI apps so that they can be deployed to a production environment.
44

5-
We are currently in the process of creating a roadmap for the product based on the community’s input.
5+
We are currently in the process of refining the roadmap for the product based on the community’s input, though it is clear that on the roadmap are more built-in DICOM parsing and DICOM OID generation capabilities to better support <a href="https://www.ihe.net/uploadedFiles/Documents/Radiology/IHE_RAD_Suppl_AIR_Rev1-2_TI_2022-07-06.pdf">IHE AIR profiles</a>, as well as serving model network in a separate process.

docs/source/release_notes/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
:hidden:
55
:maxdepth: 2
66
7+
```
8+
## Version 0.5
9+
10+
```{toctree}
11+
:maxdepth: 1
12+
13+
v0.5.0
714
```
815
## Version 0.4
916

0 commit comments

Comments
 (0)