Official Implementation of: Anatomy-Informed Deep Learning and Radiomics for Automated Neurofibroma Segmentation in Whole-Body MRI.
Authors: Georgii Kolokolnikov, Marie-Lena Schmallhofer, Lennart Well, Said Farschtschi, Victor-Felix Mautner, Inka Ristow, and René Werner.
-
Neurofibromatosis Type 1 (NF1) is a genetic disorder characterized by neurofibromas. Accurate segmentation in WB-MRI scans is crucial for NF1 patient management, but manual methods are time-consuming and variable. Additionally, existing fully-automated approaches have shown limited success, especially in handling the diverse morphology and anatomical distribution of neurofibromas (NFs) across body regions.
-
This project presents an automated anatomy-informed pipeline for NF segmentation in T2-weighted fat-suppressed WB-MRI. Inspired by the Radiology Sample App from MONAI Label, the pipeline integrates seamlessly with 3D Slicer, enabling enhanced usability and potential for future extension.
-
The provided code sets up a backend MONAI Label server that performs segmentation logic. It is recommended to be run on a cluster or a dedicated GPU-equipped machine. 3D Slicer can be used on a client side to get access to the backend MONAI Label server.
-
The proposed automated anatomy-informed pipeline for NF segmentation is depicted below:
🎬 Click here to watch a video demonstration of the NF segmentation pipeline.
The pipeline offers multiple modes:
-
Single-Stage NF Segmentation: Fast segmentation with a single 3D anisotropic U-Net.
-
Multi-Stage NF Segmentation: Anatomy-informed segmentation with an ensemble of 3D anisotropic U-Nets.
Stages of the pipeline (Click to Expand)
-
Anatomy Segmentation: Performed using MRSegmentator, which segments anatomical structures and generates a mask. The mask is processed, including addition of a high-risk zone for NF occurrence around the lungs and spine.
-
Ensemble of 3D Anisotropic Anatomy-Informed U-Nets: Uses anatomical context to enhance segmentation accuracy across distinct anatomical regions.
-
Confidence Thresholding: A default threshold of 0.5 is applied to the segmentation results, balancing sensitivity and specificity.
-
-
Post-Processing Modes:
- Low / Medium / High Confidence Filtering: Applies a threshold of 0.25, 0.5, or 0.75 to the predicted segmentation probability mask.
- Tumor Candidate Classification: Uses radiomic features to classify each tumor candidate defined via connected component analysis.
-
Anatomy Segmentation: Segments anatomical structures using MRSegmentator, and identifies a high-risk zone around the lungs and spine where NFs are most likely to occur.
- Hardware: GPU recommended (8 GB VRAM min.).
- Software: Python 3.9, MONAI Label, MRSegmentator, nnU-Net, PyRadiomics. Full list of dependencies in
environment.yml
.
-
Clone repository and set up environment:
git clone https://github.com/IPMI-ICNS-UKE/NFSegmentationPipeline.git conda env create -f environment.yml -n nf_segmentation_pipeline
-
Download and set up model weights (Zenodo):
cd NFSegmentationPipeline/nf_segmentation_app/ wget https://zenodo.org/record/14035133/files/model.zip unzip model.zip && rm model.zip
- Install 3D Slicer.
- Install the MONAI Label Plugin in 3D Slicer following these instructions.
Server-side
- Activate environment:
conda activate nf_segmentation_pipeline
- Launch MONAI Label Server:
bash launch_nf_segmentation_server.sh
- Configurable pipeline options in
launch_nf_segmentation_server.sh
:- GPU selection:
CUDA_VISIBLE_DEVICES=0
. - Sliding window batch size:
--conf batch_size 2
. - Resample in 2D:
--conf resample_only_in_2d True
- Port:
--port 8000
.
- GPU selection:
Click here for more MONAI Label command-line options.
Client-side
-
Launch 3D Slicer and connect to the MONAI Label server.
-
Upload MRI data to the MONAI Label server.
-
Select NF segmentation mode (Single-Stage or Multi-Stage).
-
Apply post-processing (confidence filtering or tumor candidate classification).
-
Optional: Apply Anatomy Segmentation to generate and show an anatomy segmentation mask.
-
Optional: Use Segment Editor for manual adjustments. Learn more about Segment Editor.
-
Submit the final version of the segmentation mask to the MONAI Label server.
-
Save the final version of the segmentation mask to the local machine.
Data: Highly anisotropic T2-weighted fat-suppressed coronal WB-MRI (1.5T, 3T) with voxel spacing of 0.625 mm x 0.625 mm x 7.8 mm in NIFTI format acquired with:
- Siemens Magnetom (Siemens Healthineers, Erlangen, Germany)
- Philips Ingenia (Best, The Netherlands)
Hardware:
- Machine 1: 64-bit Ubuntu 22.04.5 LTS with an AMD Ryzen Threadripper Pro 3975WX CPU and an NVIDIA RTX A6000 GPU
- Machine 2: 64-bit Ubuntu 22.04.4 LTS with an AMD Ryzen 9 7950X3D CPU and an NVIDIA GeForce RTX 4090 GPU
Approximate Inference Times on the Machine 2 with batch size = 2:
- Single-Stage NF Segmentation: 10 seconds
- Multi-Stage NF Segmentation (with Anatomy): 60 seconds
- Post-Processing (Low/Medium/High Confidence Filter): 1 second
- Tumor Candidate Classification (Needs Anatomy): ~120 seconds per patient with approximately 600 tumor candidates
- Anatomy Segmentation: 40 seconds
For questions, feedback, or collaboration inquiries, please contact:
For technical issues or feature requests, please open an issue in this repository’s Issues section.