Skip to content

Doc changes for addressing issues and for releasing App SDK v0.5 #373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 19, 2022
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
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,15 @@ YouTube Video:
- [Spleen Organ Segmentation - Jupyter Notebook Tutorial](https://www.youtube.com/watch?v=cqDVxzYt9lY)
- [Spleen Organ Segmentation - Deep Dive](https://www.youtube.com/watch?v=nivgfD4pwWE)

### [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)
### [4) Creating a Segmentation app](https://docs.monai.io/projects/monai-deploy-app-sdk/en/latest/getting_started/tutorials/03_segmentation_viz_app.html)

### [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)

### [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)
### [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)

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

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

- ai_livertumor_seg_app
- ai_spleen_seg_app
- ai_unetr_seg_app
- dicom_series_to_image_app
Expand Down
6 changes: 4 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Sphinx==4.1.2
sphinx-autobuild==2021.3.14
myst-parser==0.15.2
numpy==1.21.2 # CVE-2021-33430
numpy>=1.21.2 # CVE-2021-33430
matplotlib==3.3.4
ipywidgets==7.6.4
pandas==1.1.5
Expand All @@ -22,11 +22,13 @@ scipy
scikit-image>=0.17.2
plotly
nibabel>=3.2.1
monai>=0.9.0
monai>=1.0.0
torch>=1.10.0
numpy-stl>=2.12.0
trimesh>=3.8.11
pydicom
PyPDF2>=2.11.1
highdicom>=0.18.2
sphinx-autodoc-typehints==1.12.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
Expand Down
2 changes: 1 addition & 1 deletion docs/source/developing_with_sdk/core_concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ graph TD

click Package "./packaging_app.html" "Go to the document" _self
click ExecPackage "./executing_packaged_app_locally.html" "Go to the document" _self
click DeployPackage "./deploying_to_the_remote_server.html" "Go to the document" _self
click DeployPackage "./deploying_and_hosting_map.html" "Go to the document" _self
```
<!-- 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) -->

Expand Down
6 changes: 6 additions & 0 deletions docs/source/developing_with_sdk/deploying_and_hosting_map.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Deploying and Hosting MONAI App Package

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.
- 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.
- 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.
- 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.
11 changes: 0 additions & 11 deletions docs/source/developing_with_sdk/deploying_to_the_remote_server.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/developing_with_sdk/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ creating_application_class
executing_app_locally.ipynb
packaging_app
executing_packaged_app_locally
deploying_to_the_remote_server
deploying_and_hosting_map
```
4 changes: 2 additions & 2 deletions docs/source/developing_with_sdk/packaging_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ In this step, the MONAI Deploy application can now be built into a deployable Do

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**).

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).
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).

### Basic Usage of MONAI Application Packager

Expand Down Expand Up @@ -67,7 +67,7 @@ Building MONAI Application Package...
Successfully built my_app:latest
```

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).
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).

```{note}
* 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/).
Expand Down
33 changes: 0 additions & 33 deletions docs/source/getting_started/tutorials/04_mis_tutorial.md

This file was deleted.

33 changes: 0 additions & 33 deletions docs/source/getting_started/tutorials/05_full_tutorial.md

This file was deleted.

11 changes: 5 additions & 6 deletions docs/source/getting_started/tutorials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
:glob:
:maxdepth: 2

01_simple_app
02_mednist_app
03_segmentation_app
04_mis_tutorial
05_full_tutorial
06_monai_bundle_app
simple_app
mednist_app
monai_bundle_app
segmentation_app
segmentation_clara-viz_app
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# 2) Creating MedNIST Classifier app
# Creating MedNIST Classifier App

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.

## Setup

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# 6) Creating a Segmentation app consuming a MONAI Bundle
# Creating a Segmentation App Consuming a MONAI Bundle

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.

## Setup

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

# Install monai-deploy-app-sdk package
pip install monai-deploy-app-sdk
pip install --upgrade monai-deploy-app-sdk

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

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

# After downloading ai_spleen_bundle_data.zip from the web browser or using gdown,
unzip -o ai_spleen_bundle_data.zip
# After downloading it using gdown, unzip the zip file saved by gdown
unzip -o ai_spleen_seg_bundle_data.zip

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

# Local execution of the app directly or using MONAI Deploy CLI
python examples/apps/ai_spleen_seg_app/app.py -i dcm/ -o output -m model.ts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# 3) Creating a Segmentation app
# Creating a Segmentation App

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.

## Setup

Expand All @@ -15,7 +17,7 @@ jupyter-lab
```

## Executing from Jupyter Notebook
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.

```{toctree}
:maxdepth: 4

Expand Down Expand Up @@ -51,20 +53,20 @@ git clone --branch main --depth 1 https://github.com/Project-MONAI/monai-deploy-
cd monai-deploy-app-sdk

# Install monai-deploy-app-sdk package
pip install monai-deploy-app-sdk
pip install --upgrade monai-deploy-app-sdk

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

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

# After downloading ai_spleen_bundle_data.zip from the web browser or using gdown,
unzip -o ai_spleen_bundle_data.zip
# After downloading it using gdown, unzip the zip file saved by gdown
unzip -o ai_spleen_seg_bundle_data.zip

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

# Local execution of the app
python examples/apps/ai_spleen_seg_app/app.py -i dcm/ -o output -m model.ts
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Creating a Segmentation App Including Including Visualization with Clara-Viz

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.

## Setup

```bash
# Create a virtual environment with Python 3.7.
# Skip if you are already in a virtual environment.
# (JupyterLab dropped its support for Python 3.6 since 2021-12-23.
# See https://github.com/jupyterlab/jupyterlab/pull/11740)
conda create -n monai python=3.7 pytorch torchvision jupyterlab cudatoolkit=11.1 -c pytorch -c conda-forge
conda activate monai

# Launch JupyterLab if you want to work on Jupyter Notebook
jupyter-lab
```

## Executing from Jupyter Notebook

```{toctree}
:maxdepth: 4

../../notebooks/tutorials/03_segmentation_viz_app.ipynb
```

```{raw} html
<p style="text-align: center;">
<a class="sphinx-bs btn text-wrap btn-outline-primary col-md-6 reference external" href="../../_static/notebooks/tutorials/03_segmentation_viz_app.ipynb">
<span>Download 03_segmentation_viz_app.ipynb</span>
</a>
</p>
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# 1) Creating a simple image processing app
# Creating a simple image processing app

This tutorial shows how to develop a simple image processing application can be created with MONAI Deploy App SDK.

## Setup

Expand Down
14 changes: 14 additions & 0 deletions docs/source/introduction/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,17 @@ It contains the following elements:
- A mechanism to locally run a MAP via App Runner
- A set of sample applications
- API documentation

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,
- generic application classes to automate the inference with MONAI Bundle
- DICOM study parsing and selection classes, as well as DICOM instance to volume image conversion
- DICOM instance writers to encapsulate AI inference results in these DICOM OID,
- DICOM Segmentation
- DICOM Basic Text Structured Report
- DICOM Encapsulated PDF
- more are coming

:::{note}
- The software and the imaging AI results generated are for research use only, and per applicable laws and regulations, are not for clinical use.
- 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.
:::
4 changes: 2 additions & 2 deletions docs/source/introduction/roadmap.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Roadmap

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
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.

We are currently in the process of creating a roadmap for the product based on the community’s input.
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.
7 changes: 7 additions & 0 deletions docs/source/release_notes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
:hidden:
:maxdepth: 2

```
## Version 0.5

```{toctree}
:maxdepth: 1

v0.5.0
```
## Version 0.4

Expand Down
Loading