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
437 commitsLast commit ≈ 1 week ago1 star0 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, and the RTsegmentator model catalog
  • 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 and versioned artifacts support consistent local processing

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. RTsegmentator Model Catalog

RTsegmentator, the companion segmentation portal, serves nodal, prostate, brain, PET and many other models behind one API. With an rtsegmentator section in the configuration, RTpipeline sends each course's planning CT to the portal, verifies the returned package against its checksummed manifest, and analyses the structures like any other source:

rtsegmentator:
  enabled: true
  url: "https://rtseg.example.org"
  models: ["total", "lung_nodules"]

Packages downloaded from the portal can be imported offline with rtpipeline rtsegmentator-import. See RTsegmentator models.

6. 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

7. 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
RTsegmentator ModelsPortal segmentation as a verified structure source
Release NotesChanges in each release

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 Aggregate Radiomics Reliability Analysis

Shared configs and versioned artifacts make consistent local processing operationally possible. RTpipeline combines validated cohort-level reliability packets, but current packets do not themselves establish federated model training, secure aggregation, differential privacy, privacy guarantees, or outcome federation. Federated learning requires a separately implemented downstream system. 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_3_0_0,
  title = {RTpipeline: Automated Radiotherapy DICOM Processing Pipeline},
  author = {Stawiski, Konrad},
  version = {3.0.0},
  url = {https://github.com/kstawiski/rtpipeline},
  year = {2026}
}

Add the DOI archived for the v3.0.0 release. CITATION.cff carries the machine-readable metadata, and GitHub's "Cite this repository" formats it. When the bytes you ran differ from the release tag, also report the immutable git commit or container digest.

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)
  • RTsegmentator and each segmentation model, when structures came from the portal (references are recorded in every imported manifest.json)

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 97%
  • HTML 1%
  • Jupyter Notebook 1%
  • Shell 1%
License
</>Source code
Code type
Application
Field
Multiple purpose

Member of community

RS4RT