First open-source radiation treatment planning system in Python
Project description
What is PortPy?
Note: The package is at its early stages of development (version 0.0.1) and we are now collecting feedback from researchers to further refine the data structure and the main functionality. We are expecting to have a stable version 1.xx around July 2023. We would love to hear your feedback.
PortPy (Planning and Optimization for Radiation Therapy) is a community effort to develop the first opensource python library to facilitate the development and clinical translation of radiotherapy cancer treatment planning algorithms. PortPy includes:
- Research-ready data and code for benchmarking, reproducibility, and community-driven development.
- Interface to an open-source optimization package CVXPy for easy/quick prototyping and out-of-the-box access to commercial/opensource optimization engines (e.g., Mosek, Gorubi, CPLEX, IPOPT).
- Visualization modules to visualize relevant plan information (e.g, dose volume histograms, dose distribution, fluence map).
- Evaluation modules to quantify plan quality with respect to established clinical metrics (e.g., RTOG metrics, dose conformality, tumor control probability, normal tissue control probability).
Data
Data needed for optimization and algorithm development (e.g., a set of beams/beamlets/voxels, dose contribution of each beamlet to each voxel) are provided for a set of pre-specified machine parameters (e.g., beam/collimator/couch angles). We will initially provide these for a set of publicly available datasets from TCIA. We hope to expand our dataset in the future. The data needed for optimization is extracted from the research version of EclipseTM treatment planning system (Varian Medical Systems) using its API.
You can download the sample patient data here.
Create a directory named './data' in the current project directory and copy the downloaded file to it, e.g ./data/Lung_Phantom_Patient_1
Quick Start
Please see below for understanding the basic functionalities of PortPy. For advance usage of PortPy, we recommend navigating through examples folder.
- To understand the most important features of PortPy, we highly recommend to go through notebook ex_1_introduction.ipynb
- One of the major computational issues while optimizing the plan arise due to large size of influence matrix. We suggest you to follow ex_2_down_sampling.py to understand how PortPy can assist in resolving it.
- You can check out ex_3_structure_operations.py to know how to perform different structure operations (e.g., boolean, margin).
- For algorithm benchmarking, the global optimal solution is provided for non-convex optimization problems resulting from beam angle optimization ex_6_boo_benchmark.ipynb and incorporating DVH constraints ex_6_dvh_benchmark.py using the mixed-integer programming on down-sampled data.
- In addition to basic visualization capabilities, PortPy provide advanced visualization by integration with 3D Slicer. Please look out notebook ex_7_Slicer.ipynb
Installing PortPy
- Installing using pip
pip install portpy
- Installing using conda
conda install -c conda-forge portpy
- Installing from source
-
Clone this repository:
git clone https://github.com/PortPy-Project/PortPy.git cd portpy
-
You need to install the dependencies in either a python virtual environment or anaconda environment. Instructions for setting up in python virtual environment are as follows:
Install all the dependencies present in requirements.txt:
python3 -m venv venv source venv/bin/activate (venv) pip install -r requirements.txt
Team
PortPy is a community project initiated at Memorial Sloan Kettering Cancer Center. It is currently developed and maintained by:
Name | Expertise | Institution |
---|---|---|
Masoud Zarepisheh | Treatment Planning and Optimization | MSK |
Saad Nadeem | Computer Vision and AI in Medical Imaging | MSK |
Gourav Jhanwar | Algorithm Design and Development | MSK |
Mojtaba Tefagh | Mathematical Modeling and Reinforcement Learning | SUT |
Vicki Taasti | Physics and Planning of Proton Therapy | MAASTRO |
Sadegh Alam | Adaptive Treatment Planning and Imaging | Cornell |
Seppo Tuomaala | Eclispe API Scripting | VARIAN |
License
PortPy code is distributed under Apache 2.0 with Commons Clause license, and is available for non-commercial academic purposes.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.