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:
1git clone https://huggingface.co/ChrisXzZ/LesionSegmenter
2conda create -n lesionseg python=3.10 -y
3conda activate lesionseg
4cd LesionSegmenter
5git clone https://github.com/MIC-DKFZ/nnUNet.git
6cd nnUNet
7python -m pip install -e .
8cd ..
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:
1nnUNet_eval/
2 └── Dataset1357/
3 └── imagesTs/
4 ├── colon_lesion_test1_0000.nii.gz
5 ├── colon_lesion_test2_0000.nii.gz
6 ├── colon_lesion_test3_0000.nii.gz
7 ├── ...
Directly run this commend in terminal:
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:
This is the organization of the final outputs:
1nUNet_predictions_BDMAP/
2 ├── colon_lesion_test1
3 └── combined_labels.nii.gz
4 └── segmentations
5 ├── liver.nii.gz
6 ├── pancreas.nii.gz
7 ├── kidney_left.nii.gz
8 ├── kidney_right.nii.gz
9 ├── colon.nii.gz
10 ├── liver_lesion.nii.gz
11 ├── colon_leison.nii.gz
12 ├── kidney_lesion.nii.gz
13 ├── pancreatic_lesion.nii.gz
14 ├── colon_lesion_test2
15 └── combined_labels.nii.gz
16 └── segmentations
17 ├── liver.nii.gz
18 ├── pancreas.nii.gz
19 ├── kidney_left.nii.gz
20 ├── kidney_right.nii.gz
21 ├── colon.nii.gz
22 ├── liver_lesion.nii.gz
23 ├── colon_leison.nii.gz
24 ├── kidney_lesion.nii.gz
25 ├── pancreatic_lesion.nii.gz
26 ├── colon_lesion_test3
27 └── combined_labels.nii.gz
28 └── segmentations
29 ├── liver.nii.gz
30 ├── pancreas.nii.gz
31 ├── kidney_left.nii.gz
32 ├── kidney_right.nii.gz
33 ├── colon.nii.gz
34 ├── liver_lesion.nii.gz
35 ├── colon_leison.nii.gz
36 ├── kidney_lesion.nii.gz
37 ├── pancreatic_lesion.nii.gz
38 ├── ...