Skip to main content
Ctrl K

RTpipeline

RTpipeline is a comprehensive, research-grade pipeline that transforms raw DICOM radiotherapy exports into analysis-ready data. It bridges the technical gap between clinical Treatment Planning Systems (TPS) and statistical/ML analysis

Get started
165 commitsLast commit ≈ 2 weeks ago6 stars0 forks

Description

RTpipeline

The Big Data Radiotherapy Pipeline

From raw clinical exports to research-ready datasets in one command.

Documentation Docker License


Overview

RTpipeline is a comprehensive, research-grade pipeline that transforms raw DICOM radiotherapy exports into analysis-ready data. It bridges the technical gap between clinical Treatment Planning Systems (TPS) and statistical/ML analysis by automating:

  • DICOM Organization - Groups scattered files into patient courses
  • AI Segmentation - TotalSegmentator (~100 standardized structures) + custom nnU-Net models
  • DVH Extraction - Comprehensive dose-volume metrics
  • Radiomics - IBSI-informed PyRadiomics features with robustness assessment
  • Multimodal Biomarkers - Opt-in PET structure metrics, functional-MR sampling, and CT body composition
  • Quality Control - Automated checks and audit reports

Who Is This For?

AudienceValue Proposition
PhD StudentsSpend your PhD on science, not reinventing DICOM parsing
Clinical ResearchersMinimal coding—drag & drop in Web UI, get Excel tables
Multi-Center ConsortiaShared configs ensure identical preprocessing at every site

Key Features

1. Standardized Anatomy via AI

Run TotalSegmentator on every CT to get consistent structure definitions:

Input: "Heart", "hrt", "Coeur", "cardiac"  (inconsistent)
Output: "heart"  (standardized for every patient)

2. Systematic CT Cropping

Normalize field-of-view using anatomical landmarks for comparable metrics:

Before: V20Gy = 500cc / 18,000cc = 2.8% (long scan)
After:  V20Gy = 500cc / 12,000cc = 4.2% (standardized FOV)

3. Robustness-Aware Radiomics

An RTpipeline-adapted NTCV chain, inspired by but not identical to Zwanenburg et al. (2019), stress-tests feature stability under the configured perturbations:

  • Noise injection (scanner variability)
  • Translation (positioning uncertainty)
  • Contour randomization (inter-observer variability)
  • Volume adaptation (segmentation uncertainty)

Features with ICC ≥ 0.90 and CoV ≤ 10% classified as robust.

4. Multimodal and Derived Biomarkers

The all-series workflow can retain and classify 4D CT, contrast-enhanced CT, PET/CT, anatomical MR, and functional MR without changing the default single-series workflow. Optional modules provide:

  • per-structure PET SUV summaries on paired PET/CT examinations;
  • ADC, perfusion, and subtraction-map sampling under anatomical MR masks;
  • CT body-composition measurements from TotalSegmentator tissue masks; and
  • all-series radiomics with provenance for the original image series.

These modules are disabled by default and require explicit configuration. PET quantitation is accepted only when SUV conversion is valid, and the optional TotalSegmentator tissue_types task has an upstream non-commercial model license.

5. Analysis-Ready Outputs

_RESULTS/
├── dvh_metrics.xlsx      # Dmean, D95%, V20Gy for every structure
├── radiomics_ct.xlsx     # PyRadiomics features with IBSI-informed settings
├── case_metadata.xlsx    # Clinical tags, scanner info
└── qc_reports.xlsx       # Quality control summary

6. High-Performance Computing

Designed for modern hardware with automatic optimization:

  • GPU Acceleration: CUDA-accelerated deep learning for segmentation
  • Smart Parallelization: Automatically scales to available CPU cores
  • Resource Management: Adaptive worker scaling prevents memory overflows
  • Speed: Process hundreds of patients in hours, not days

Quick Start

Option 1: Interactive Docker Setup (Recommended)

curl -sSL https://raw.githubusercontent.com/kstawiski/rtpipeline/main/setup_docker_project.sh | bash

Option 2: Docker Compose

# Create folders
mkdir -p Input Output Logs

# Start pipeline + Web UI
docker-compose up -d

# Open http://localhost:8080

Option 3: Google Colab

Try it in the cloud with free GPU access:

Option 4: Local Installation

git clone https://github.com/kstawiski/rtpipeline.git
cd rtpipeline
snakemake --cores all --use-conda

Documentation

Full documentation at kstawiski.github.io/rtpipeline

SectionDescription
Getting StartedFrom zero to first analyzed patient
Web UI GuideDrag-and-drop interface
Output FormatData table schemas
Case StudiesReal-world research examples
ReproducibilityMethods templates for publications
Local installationAutomatic macOS, Linux, and WSL2 setup
Radiomics RobustnessNTCV perturbation methodology
Distributed AnalysisHash-bound cohort-level packet export and aggregation

Case Studies

1. NTCP Modeling for Rectal Toxicity

Build dose-response models from standardized DVH metrics. Learn more →

2. Radiomics Signature Development

Create robust imaging biomarkers with NTCV perturbation assessment. Learn more →

3. Distributed Multi-Center Reliability Analysis

Run the same method locally and combine only validated cohort-level reliability packets. Learn more →


Architecture

┌─────────────────┐     ┌──────────────────────────────────┐     ┌─────────────────┐
│     EXTRACT     │     │           TRANSFORM              │     │      LOAD       │
│                 │     │                                  │     │                 │
│  • DICOM CT     │     │  • Structure harmonization       │     │  • DVH tables   │
│  • RTSTRUCT     │ ──► │  • TotalSegmentator              │ ──► │  • Radiomics    │
│  • RTDOSE       │     │  • Systematic cropping           │     │  • Metadata     │
│  • RTPLAN       │     │  • Robustness analysis           │     │  • QC reports   │
│                 │     │                                  │     │                 │
└─────────────────┘     └──────────────────────────────────┘     └─────────────────┘

Citation

If you use RTpipeline in your research, cite the software itself:

@software{rtpipeline,
  title = {RTpipeline: Automated Radiotherapy DICOM Processing Pipeline},
  author = {Stawiski, Konrad},
  url = {https://github.com/kstawiski/rtpipeline},
  year = {2026}
}

The repository also includes CITATION.cff for machine-readable citation metadata.

Also cite the underlying tools:

  • TotalSegmentator: Wasserthal et al., Radiology: AI (2023)
  • PyRadiomics: van Griethuysen et al., Cancer Research (2017)
  • IBSI: Zwanenburg et al., Radiology (2020)

License

MIT License - see LICENSE for details. TotalSegmentator model/task licensing is upstream-specific; the optional tissue_types task used for body-composition extraction is under the TotalSegmentator non-commercial license.


Note: Model weights for TotalSegmentator are downloaded automatically. Custom nnU-Net models must be provided separately. See documentation for details.

Keywords
Programming languages
  • Python 89%
  • Jupyter Notebook 4%
  • Shell 4%
  • HTML 2%
License
</>Source code
Code type
Application
Field
Multiple purpose

Member of community

RS4RT