A lightweight GUI tool that integrates nnUNet and U-Mamba inference with automatic post-processing for coronary artery segmentation in CT images.
| Feature | Details |
|---|---|
| Model selection | nnUNet (standard), U-Mamba Bot, U-Mamba Enc |
| One-click inference | Wraps nnUNetv2_predict with GUI-configurable parameters |
| Post-processing | Retains the two largest connected components (LCA / RCA) and resolves intra-component label mixing |
| Live log | Streams inference output in real time |
| Cross-platform | Windows / Linux |
coronary_pipeline/
├── coronary_pipeline_gui.py # Main GUI application
├── postprocess.py # Post-processing module (importable)
├── requirements.txt
└── README.md
pip install -r requirements.txt
| Tool | URL |
|---|---|
| nnUNet v2 | https://github.com/MIC-DKFZ/nnUNet |
| U-Mamba (optional) | https://github.com/bowang-lab/U-Mamba |
Pre-trained model checkpoints are available on Hugging Face:
Download the checkpoints and place them in your model directories:
nnUNet/checkpoint_final.pth→ your nnUNet model folderUMambaBot/checkpoint_final.pth→ your UMambaBot model folder
Then specify each path in coronary_pipeline_gui.py when prompted.
conda activate nnunet # or your environment name# Linux / macOS
export nnUNet_raw="/path/to/nnUNet_raw"
export nnUNet_preprocessed="/path/to/nnUNet_preprocessed"
export nnUNet_results="/path/to/nnUNet_results"
# Windows (PowerShell)
$env:nnUNet_raw = "C:\path\to\nnUNet_raw"
$env:nnUNet_preprocessed = "C:\path\to\nnUNet_preprocessed"
$env:nnUNet_results = "C:\path\to\nnUNet_results"python coronary_pipeline_gui.py- Input folder — directory containing CT NIfTI files (
case_*.nii.gz) - Output folder — pipeline writes two subdirectories here:
raw_predictions/— directnnUNetv2_predictoutputpostprocessed/— top-2 connected-component filtered masks
- Model — select nnUNet or U-Mamba variant
- Dataset ID / Configuration / Fold / Checkpoint — match your trained model
- Save probability maps — passes
--save_probabilitiesto nnUNetv2_predict - Run post-processing — enable/disable the connected-component step
- Click ▶ Run Pipeline
For each predicted mask:
- Binary labeling — all non-zero voxels are treated as foreground.
- Connected-component analysis —
scipy.ndimage.labelidentifies all components. - Top-N selection — the two largest components are retained (LCA and RCA).
- Label-mixing correction — within each retained component, the majority semantic label (1 = LCA, 2 = RCA) is assigned to all voxels, correcting any erroneous minority-label voxels produced by the network.
The module can also be used independently:
from postprocess import run_postprocess
run_postprocess(
input_dir="path/to/raw_predictions",
output_dir="path/to/postprocessed",
top_n=2,
log_callback=print,
)If you use this tool in your research, please cite:
Hattori et al. (2026). SlicerPcatMeasure: A 3D Slicer Extension for Pericoronary Adipose Tissue Quantification. SoftwareX. (under review)
MIT License — see LICENSE for details.


