This repository provides a MONAI Label app that integrates customized nnUNet v2 models into the MONAI Label framework. It enables interactive and batch segmentation of medical data directly from 3D Slicer or via the MONAI Label REST API.
└── main.py # Entry point for starting MONAI Label app
└── lib # Entry point for starting MONAI Label app
└── config
└── nnunet.py # TaskConfig binding nnUNet into MONAI Label
└── infer
└── nnunet_segmentation.py # nnUNet wrapper + MONAI InferTask
...
└── model/ # Directory for storing trained nnUNet models
└── nnunet/...
- Python 3.9+
- MONAI Label ≥ 0.7
- nnUNet v2 (installed and trained models available)
- 3D Slicer (with MONAI Label extension)
Example:
monailabel start_server --app nnunet_heart --studies ~/Dataset --conf models nnunetThis starts the MONAI Label server with your nnUNet heart model.
-
Create a directory in the home directory: nnunet_heart/model
-
Prepare the model:
-
The example model link:
-
For a typical nnUNet, the model directory will be nnUNetv2/nnUNet_results/Dataset101_modality/NetTrainer__nnUNetPlans__3d_fullres
-
Monailabel extension tutorial in 3D slicer: Quickstart
Open 3D Slicer.
Install and enable the MONAI Label extension.
Connect to your running server (http://127.0.0.1:8000).
Click Next Sample
Use the Auto-Segmentation → nnunet_model option and click Run to generate the segmentation.
-
Auto-Segmentation with nnUNet v2 (nnunet_segmentation.py handles preprocessing, inference, and postprocessing).
-
Custom Configs: specify target spacing, spatial ROI, folds, and model path in nnunet.py.
-
Segmented labels are saved back into the studies folder under Dataset/labels/final.
-
Extendable:
-
Add more models by writing new TaskConfig classes in lib/configs.
-
Batch Inference: run segmentation on all studies in the datastore.
-
The app can be extended with active learning strategies and scoring methods if needed.
-