Automated CT-based pelvimetry pipeline for measuring pelvic bony landmarks, validated against manual 3D Slicer measurements.
This pipeline extracts 6 pelvic morphometric measurements from CT scans using AI-based segmentation (TotalSegmentator):
| Metric | Description |
|---|---|
| ISD | Interspinous Distance (mm) |
| Inlet AP | Pelvic Inlet Antero-Posterior Diameter (mm) |
| Outlet AP | Pelvic Outlet Antero-Posterior Diameter (mm) |
| Outlet Transverse | Intertuberous Distance (mm) |
| Sacral Length | Promontory → Coccygeal Apex (mm) |
| Sacral Depth | Maximum Anterior Sacral Concavity (mm) |
Additionally, Outlet Area (cm²) is derived as an ellipse approximation (π/4 × Outlet AP × Outlet Transverse).
├── Pipeline/
│ ├── Combined_Pelvimetry_Pipeline_v6.3.py # Main pipeline
│ ├── Error_Handling_System.py # Metric-level error tracking (required)
│ ├── Body_Composition_Analysis.py # Body composition analysis (see note below)
│ └── requirements.txt # Pipeline-specific dependencies
├── Notebooks/
│ ├── 1_Data_Cleaning.ipynb # Cohort construction & data merging
│ ├── 2_Validation.ipynb # ICC, Bland-Altman analysis
│ └── 3_Clinical_Association.ipynb # Clinical outcome association
├── README.md
└── .gitignore
Note:
Error_Handling_System.pymust be in the same directory as the main pipeline. It providesMetricResult,ErrorLogger, andsafe_executefor per-metric error isolation and structured failure logging.
Body_Composition_Analysis.py is a standalone module for computing body composition metrics (VAT, SAT, V/S ratio, skeletal muscle area) at the L3 vertebral level and mid-pelvis (ISD level) from TotalSegmentator tissue-type segmentations. It depends on the pelvimetry pipeline's CSV output for ISD-level slice localization. This module was not used in the current study but is included for reference and potential future analyses.
pip install -r requirements.txt| Tool | Purpose | Installation |
|---|---|---|
| dcm2niix | DICOM → NIfTI conversion | brew install dcm2niix (macOS) |
| TotalSegmentator | AI anatomical segmentation | pip install TotalSegmentator |
cd Pipeline/Main_Pipeline
python Combined_Pelvimetry_Pipeline_v6.3.py \
--mode single \
--patient-id Patient_001 \
--dicom-dir /path/to/Patient_001/DICOM \
--output-dir /path/to/outputpython Combined_Pelvimetry_Pipeline_v6.3.py \
--mode batch \
--input-dir /path/to/all_patients \
--output-dir /path/to/outputIf segmentations already exist:
python Combined_Pelvimetry_Pipeline_v6.3.py \
--mode measure \
--nifti /path/to/patient.nii.gz \
--seg-dir /path/to/segmentation_folder \
--output-dir /path/to/output- CSV: One row per patient with all metric values, anatomical landmark coordinates (World RAS), and pipeline status
- QC Figures: Sagittal combined and extended axial QC images (per patient)
- Error Log: Structured error log with per-metric failure taxonomy
| Status | Meaning |
|---|---|
Success |
All 6 metrics computed |
Partial_N/6 |
N of 6 metrics computed; see Error_Log for details |
Failure |
No metrics computed |
This project is provided for academic and research purposes.