--- license: cc-by-4.0 --- 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: ```bash 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: ```bash 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 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 bash post_process.sh ``` This is the organization of the final outputs: ```bash 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 ├── ... ```