This repository provides the nnUNet v2 checkpoint for multi-organ lesion segmentation from abdominal CT images.
The model was trained on a large-scale multi-center CT dataset with expert-annotated lesion masks across multiple organs (liver, pancreas, kidney, colon).
First of all, you need a Linux OS server and basic terminal usage.
You also need a NVIDIA GPU with Driver Version: 570.124.05 and CUDA Version: 12.8 at least
0. Before you start
You need: CT files in .nii.gz format
Each CT is a 3D volume (not single images)
1. Installation (Environment and nnUNet packages)
Directly run the following commends in terminal:
git clone https://huggingface.co/ChrisXzZ/LesionSegmenter
conda create -n lesionseg python=3.10 -y
conda activate lesionseg
cd LesionSegmenter
git clone https://github.com/MIC-DKFZ/nnUNet.git
cd nnUNet
python -m pip install -e .
cd ..
2. Run inference on example CT scans
Example CT scans are stored in this path: ./nnUNet_eval/Dataset1357/imagesTs/
This is the organization of example CT scans:
nnUNet_eval/
βββ Dataset1357/
βββ imagesTs/
βββ colon_lesion_test1_0000.nii.gz
βββ colon_lesion_test2_0000.nii.gz
βββ colon_lesion_test3_0000.nii.gz
βββ ...
Directly run this commend in terminal:
bash inference.sh
If you want to run inference on your own CT scans, please directly put them in the same folder that contain example CT scans. Also, please make sure that the name of your CT scan file is end with "_0000.nii.gz"
3. Run post-processing and output results in BDMAP format
Directly run this commend in terminal:
bash post_process.sh
This is the organization of the final outputs:
nUNet_predictions_BDMAP/
βββ colon_lesion_test1
βββ combined_labels.nii.gz
βββ segmentations
βββ liver.nii.gz
βββ pancreas.nii.gz
βββ kidney_left.nii.gz
βββ kidney_right.nii.gz
βββ colon.nii.gz
βββ liver_lesion.nii.gz
βββ colon_leison.nii.gz
βββ kidney_lesion.nii.gz
βββ pancreatic_lesion.nii.gz
βββ colon_lesion_test2
βββ combined_labels.nii.gz
βββ segmentations
βββ liver.nii.gz
βββ pancreas.nii.gz
βββ kidney_left.nii.gz
βββ kidney_right.nii.gz
βββ colon.nii.gz
βββ liver_lesion.nii.gz
βββ colon_leison.nii.gz
βββ kidney_lesion.nii.gz
βββ pancreatic_lesion.nii.gz
βββ colon_lesion_test3
βββ combined_labels.nii.gz
βββ segmentations
βββ liver.nii.gz
βββ pancreas.nii.gz
βββ kidney_left.nii.gz
βββ kidney_right.nii.gz
βββ colon.nii.gz
βββ liver_lesion.nii.gz
βββ colon_leison.nii.gz
βββ kidney_lesion.nii.gz
βββ pancreatic_lesion.nii.gz
βββ ...