Quickstart

The following section will provide a step by step guide to get started with MONAI Label using the left atrium DeepEdit annotation sample app.

DeepEdit Annotation with a Standard Dataset

Deploy DeepEdit on MONAI Label Server

On the local machine follow the commands listed below to install MONAI Label, download a sample application (DeepEdit left atrium annotation), download a sample dataset (MSD heart MRI), and deploy the sample app and dataset on the MONAI Label server.

# install MONAI Label
pip install monailabel

# download left atrium DeepEdit sample app to local directory
monailabel apps --name deepedit_left_atrium --download --output .

# download Task 2 MSD dataset
monailabel datasets --download --name Task02_Heart --output .

# start the left atrium DeepEdit app in MONAI label server
# an start annotating the downloaded images
monailabel start_server --app deepedit_left_atrium --studies Task02_Heart/imagesTr

Install MONAI Label Plugin in 3DSlicer

Install 3DSlicer Preview Version with in-built MONAI Label plugin

  • Download and Install 3D Slicer and choose one of the download links under Preview Release

  • Start 3DSlicer

  • On the menu bar navigate View -> Extension Manager -> Active Learning -> MONAI Label

    3DSlicer Extensions Manager
  • Install MONAI Label plugin (click “Install”)

  • Restart 3D Slicer (click “Restart” in the same dialog box)

To add the MONAI Label icon shortcut on the 3DSlicer toolbar

  • Navigate Edit -> Application Settings

  • Under the Modules panel drag MONAI Label into Favorite Modules

    MONAI Label Favorite Module
  • Restart 3DSlicer

  • Look for the MONAI Label module icon MLIcon in the 3DSlicer toolbar

DeepEdit Annotation in 3DSlicer

To connect 3DSlicer to MONAI Label Server

  • Click on the MONAI Label module icon

  • Click the refresh icon near next to the MONAI Label server input field

    • If the MONAI Label server is running locally to 3DSlicer you do not need to enter the server address

    MONAI Label Refresh Button

To annotate the downloaded heart MR images using DeepEdit

  • Click Next Sample under Strategy to retrieve an image from the heart dataset along with a segmentation result generated by DeepEdit

    Next Sample
  • We can now start making adjustments to the initial segmentation provided by adding foreground and background points using the tools in the SmartEdit section

    • For example, click on the foreground button and start clicking on the image panel to start seeing how foreground points affect the segmentation

    MONAI Label SmartEdit
  • Once we are satisfied with the segmentation we can Submit Label

    MONAI Label Submit Label Button
  • We repeat the last four steps until our dataset is annotated

DeepEdit Annotation with a Custom Dataset

To annotate a custom dataset using DeepEdit, we can donwload the DeepEdit app as above, however, the dataset directory need not be populated. Follow the commands below to setup custom dataset annotation.

# install MONAI Label
pip install monailabel

# download left atrium DeepEdit sample app to local directory
monailabel apps --name deepedit_left_atrium --download --output .

# create an empty folder for the custom dataset
mkdir my_dataset

# start the left atrium DeepEdit app in MONAI label server
# on the empty dataset folder
monailabel start_server --app deepedit_left_atrium --studies my_dataset

We can follow the instructions in the previous section to install and connect 3DSlicer to MONAI Label Server, however, in this scenario we will instead load a file into MONAI Label Server through 3DSlicer.

  • Load an image file by navigating the menu bar File -> Add Data

  • Click the referesh button under MONAI Label Server to connect to the server

  • Click the Upload Volume button to upload the new image onto the server

    MONAI Label Upload Image
  • Now, all DeepEdit functions should be available to use and we use foreground and background clicks