Skip to content

Zangir/MAGIC-CT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MAGIC-CT: Multiorgan Annotation and Grounded Image Captioning in CT for Cancer

Dataset License: Code License: Dataset Python 3.8+

Official evaluation scripts for the MAGIC-CT dataset.

πŸ“‹ Overview

MAGIC-CT is a comprehensive multimodal dataset for abdominal oncology combining:

  • 562 patients with contrast-enhanced CT scans
  • ~1,250 annotated lesions across 8 pathologies (4 organs)
  • 4,937 organ descriptions in 3 languages (EN/RU/KZ)
  • Expert-validated 3D segmentation masks
  • Rich clinical narratives by radiologists

Pathologies: Liver cancer (HCC), renal cancer, lung cancer, pancreatic cancer, liver cysts, kidney cysts, lung metastases, liver metastases

πŸ“Š Dataset

Download from Zenodo: https://zenodo.org/uploads/18389015

Expected structure after extraction:

data/
β”œβ”€β”€ scans/
β”‚   β”œβ”€β”€ liver_cancer/
β”‚   β”‚   β”œβ”€β”€ patient_001.nrrd
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ kidney_cyst/
β”‚   β”œβ”€β”€ renal_cancer/
β”‚   └── ...
└── segmentations/
    β”œβ”€β”€ liver_cancer/
    β”‚   β”œβ”€β”€ patient_001.nrrd
    β”‚   └── ...
    └── ...

πŸš€ Installation

# Clone repository
git clone https://github.com/maxtrubetskoy/MagicCT.git
cd MagicCT

# Install dependencies
pip install -r requirements.txt

Requirements: Python 3.8+, PyTorch 1.12+, MONAI 1.2+, CUDA 11.3+ (for GPU)

⚑ Quick Start

Evaluate Single Model

python evaluate.py --model swinunetr --data_dir data/ --output results/

Evaluate All Models (Reproduce Paper Results)

python evaluate.py --model all --data_dir data/ --output results/ --device cuda

With GPU Acceleration

python evaluate.py --model all --data_dir data/ --device cuda

Specific Cancer Types

python evaluate.py --model swinunetr --data_dir data/ \
    --cancer_types liver_cancer lung_cancer renal_cancer

Save Prediction Masks

python evaluate.py --model swinunetr --data_dir data/ --save_predictions

πŸ“‹ Command-Line Options

python evaluate.py --help

Main arguments:

  • --model: Model name (swinunetr, unetr, segresnet, dynunet, or all)
  • --data_dir: Path to dataset directory (containing scans/ and segmentations/)
  • --output: Output directory for results (default: results/)
  • --cancer_types: Specific cancer types to evaluate (default: all 8 types)
  • --device: Device (auto, cuda, or cpu; default: auto-detect)
  • --batch_size: Batch size (default: 1)
  • --workers: Number of data loading workers (default: 4)
  • --roi_size: ROI size for input (default: 96 96 96)
  • --save_predictions: Save prediction masks as .nrrd files

πŸ“ˆ Expected Results

Table 2 from Paper - Overall Model Performance:

Model Dice (%) HD95 (mm) Sensitivity (%) Specificity (%) Inference Time (s) Params (M)
SwinUNETR 72.3 Β± 2.1 8.2 Β± 2.1 75.9 Β± 5.1 98.9 Β± 0.7 2.8 61.9
UNETR 68.7 Β± 2.3 9.4 Β± 2.8 73.4 Β± 4.6 99.2 Β± 0.6 2.5 102.4
SegResNet 65.2 Β± 1.9 11.2 Β± 3.1 67.3 Β± 5.6 98.7 Β± 0.8 1.2 15.7
DynUNet 67.1 Β± 2.0 10.1 Β± 2.9 69.6 Β± 5.7 99.4 Β± 0.5 1.8 22.3

Table 3 from Paper - Cancer-Type Specific Performance (Dice %):

Cancer Type SwinUNETR UNETR SegResNet DynUNet
Benign Lesions
Liver Cysts 84.3 Β± 3.2 80.7 Β± 3.8 76.9 Β± 4.1 79.3 Β± 4.5
Kidney Cysts 81.0 Β± 3.8 77.6 Β± 4.2 73.6 Β± 4.6 76.0 Β± 4.8
Primary Malignancies
Hepatocellular Carcinoma 78.1 Β± 4.2 74.5 Β± 4.6 70.5 Β± 5.1 72.8 Β± 5.3
Lung Cancer 74.9 Β± 4.8 71.4 Β± 5.2 67.7 Β± 5.5 69.6 Β± 5.7
Renal Cancer 71.6 Β± 5.1 68.0 Β± 5.4 64.4 Β± 5.8 66.2 Β± 6.0
Pancreas Cancer 53.1 Β± 7.8 49.3 Β± 8.1 46.8 Β± 8.4 47.9 Β± 8.6
Metastatic Disease
Lung Metastases 63.0 Β± 6.2 59.4 Β± 6.8 56.5 Β± 7.1 57.9 Β± 7.4

πŸ”— Model Weights

Models use MONAI framework with pretrained weights:

SwinUNETR (Recommended for best results):

Other models (UNETR, SegResNet, DynUNet):

  • Use MONAI's built-in architectures
  • No additional weights required
# Optional: Download SwinUNETR pretrained weights for better results
mkdir -p pretrained
cd pretrained
wget https://github.com/Project-MONAI/MONAI-extra-test-data/releases/download/0.8.1/swin_unetr.base_5000ep_f48_lr2e-4_pretrained.pt
cd ..

πŸ“ Output Structure

results/
β”œβ”€β”€ swinunetr/
β”‚   β”œβ”€β”€ results.csv       # Per-case metrics (Dice, HD95, sensitivity, specificity)
β”‚   β”œβ”€β”€ summary.json      # Aggregate statistics (mean Β± std)
β”‚   └── predictions/      # (optional) .nrrd prediction masks
β”œβ”€β”€ unetr/
β”œβ”€β”€ segresnet/
β”œβ”€β”€ dynunet/
└── comparison.csv        # Model comparison table

πŸ”¬ Technical Details

Dataset Statistics:

  • Total patients: 562 (492 with reports)
  • Age: 63 Β± 14 years (range: 19-92)
  • Gender: 52% male, 46% female
  • Imaging: Contrast-enhanced CT (Philips Ingenuity)
  • Contrast agents: Ultravist 370, Gadovist
  • Radiation dose: 7-15 mSv

Annotations:

  • Annotators: 7 radiologists
  • Inter-annotator agreement: Cohen's ΞΊ = 0.74 ("Substantial")
  • Software: 3D Slicer
  • Format: .nrrd (NRRD format with spatial metadata)

πŸ“– Citation

If you use this dataset or code, please cite:

@article{popov2025magicct,
  title={{MAGIC-CT}: Multiorgan Annotation and Grounded Image Captioning in {CT} for Cancer},
  author={Popov, Maxim and Iklassov, Zangir and Baimagambet, Zhanas and Jakipov, Murat and Andreyeva, Xeniya and Akhtar, Muhammad and Tak\'{a}\v{c}, Martin and Jamwal, Prashant},
  year={2026},
  doi={10.5281/zenodo.17549293},
  url={https://zenodo.org/uploads/18389015}
}

πŸ‘₯ Authors

Corresponding Author: Maxim Popov (maxim.popov@nu.edu.kz)

  1. Maxim Popov - Nazarbayev University, Kazakhstan
  2. Zangir Iklassov - Mohamed bin Zayed University of AI (MBZUAI), UAE
  3. Zhanas Baimagambet - Nazarbayev University, Kazakhstan
  4. Murat Jakipov - National Research Oncology Center (NROC), Kazakhstan
  5. Xeniya Andreyeva - National Research Oncology Center (NROC), Kazakhstan
  6. Muhammad Akhtar - Nazarbayev University, Kazakhstan
  7. Martin TakÑč - Mohamed bin Zayed University of AI (MBZUAI), UAE
  8. Prashant Jamwal - Nazarbayev University, Kazakhstan (Team Lead)

πŸ™ Acknowledgments

This work was supported by:

  • Collaborative Research Program of Nazarbayev University (Grant No. 111024CRP2007)
  • National Research Oncology Center (NROC), Astana, Kazakhstan
  • MONAI Consortium for framework support

πŸ“„ License

  • Code: MIT License (see LICENSE)
  • Dataset: CC0 1.0 Universal (Public Domain)

πŸ› Issues & Questions

πŸ”— Links


Last Updated: February 2026

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages