Skip to content

mrfil/nnunet_heart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MONAI Label – nnUNet Heart Segmentation App

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.


Repository Structure

└── 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/...

Requirements


Running the App

1. Start the MONAI Label Server

Example:

monailabel start_server --app nnunet_heart --studies ~/Dataset --conf models nnunet

This starts the MONAI Label server with your nnUNet heart model.

2. Pre-trained model preparation

  • 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

3. Connect via 3D Slicer

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.

4. Features

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

About

Use pre-trained nnUNet for monailabel workflow

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages