Skip to content

Commit fdd3fc0

Browse files
committed
update
1 parent 1188865 commit fdd3fc0

File tree

11 files changed

+282
-52
lines changed

11 files changed

+282
-52
lines changed

docs/FAQ.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
2+
### **What kind of license does PortPy use?**
3+
PortPy code is distributed under the **Apache 2.0 license with the Commons Clause**.
4+
It is available **free for non-commercial academic purposes**.
5+
For commercial use, please contact the PortPy PI, Masoud Zarepisheh at [zarepism@mskcc.org](mailto:zarepism@mskcc.org).
6+
7+
---
8+
9+
### **How can I use my own patient data?**
10+
PortPy currently supports importing patient data only from the **Eclipse TPS** using its API
11+
([see notebook](https://github.com/PortPy-Project/PortPy/blob/master/examples/eclipse_photon_dose_calculation.ipynb)). This includes extracting all necessary data for optimization,
12+
such as the **dose influence matrix** (i.e., a 2D matrix representing 3D dose distributions
13+
from thousands of beamlets).
14+
15+
---
16+
17+
### **Can I use other open-source software for dose calculation and PortPy for planning optimization?**
18+
One of PortPy’s goals is to generate **clinically usable, deliverable plans** with dose calculations
19+
that match commercial TPS accuracy. Therefore, we currently do **not** support integrating
20+
other open-source dose engines into PortPy.
21+
22+
However, users are welcome to use other software for dose calculation and PortPy solely for
23+
optimization **if clinical-level dose accuracy is not required** for their use case.
24+
25+
---
26+
27+
### **Can I do proton therapy optimization with PortPy?**
28+
Currently, PortPy only supports **photon therapy optimization**.
29+
Proton therapy support is expected to be released in 2026.
30+
31+
---
32+
33+
### **I have a medical physics background but not in mathematical optimization. Can I still use PortPy?**
34+
Absolutely. PortPy is designed to be **user-friendly and accessible**.
35+
You can get started using our ready-made **Jupyter Notebooks and tutorials** without needing
36+
a deep understanding of optimization theory.
37+
38+
---
39+
40+
### **I have a mathematical optimization background but not in medical physics. Can I still use PortPy?**
41+
Yes. Many PortPy contributors come from optimization and engineering backgrounds.
42+
The **benchmark datasets** and **baseline algorithms** are designed to help users without
43+
medical physics expertise explore radiotherapy treatment planning.
44+
45+
---
46+
47+
### **I have an engineering/software development background. Can I contribute to PortPy?**
48+
Yes! PortPy is an open-source project and **welcomes community contributions**.
49+
Please reach out to Gourav Jhanwar, Lead Developer ([jhanwarg@mskcc.org](mailto:jhanwarg@mskcc.org)).
50+
51+

docs/contact_us.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
If you encounter a bug or have questions about using PortPy, we recommend creating an **Issue on GitHub**: 👉 [GitHub Issues](https://github.com/PortPy-Project/PortPy/issues)
2+
This ensures your question is tracked and helps other users who may face similar issues.
3+
4+
If you prefer to communicate via email:
5+
6+
- For technical questions, contact the lead developer:
7+
Gourav Jhanwar — [jhanwarg@mskcc.org](mailto:jhanwarg@mskcc.org)
8+
9+
- For general inquiries, contact the PI:
10+
Masoud Zarepisheh — [zarepism@mskcc.org](mailto:zarepism@mskcc.org)

docs/images/AI_Pyramid.png

201 KB
Loading

docs/images/Linac.gif

1.28 MB
Loading

docs/index.md

Lines changed: 125 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,140 @@
1-
PortPy
1+
# What is PortPy?
22

3-
> Modern Portfolio Optimization in Python
3+
<img src="./images/Linac.gif" align="right" alt="Radiotherapy 101" width="30%" height="30%" margin-right="10px">
44

5-
---
6-
Test7
7-
Welcome to **PortPy**! Effortlessly optimize, analyze, and visualize your investment portfolios with a modern, user-friendly Python library.
5+
**PortPy**, short for **P**lanning and **O**ptimization for **R**adiation **T**herapy, is an open-source Python library
6+
designed to advance cancer radiotherapy treatment planning optimization. Radiotherapy plays a critical role in
7+
treating over half of all cancer patients, whether as a standalone treatment or in combination with surgery,
8+
chemotherapy, or immunotherapy. It works by delivering high-energy radiation beams to tumors, aiming to destroy
9+
cancerous cells while minimizing damage to the surrounding healthy tissues.
10+
Given that each patient has a unique anatomy, it is essential to customize the
11+
radiation beams' shape, angle, and intensity. The goal is to maximize damage to the
12+
tumor while minimizing exposure to healthy surrounding tissues. This challenge translates into modeling and
13+
solving large-scale,
14+
patient-specific mathematical optimization problems. PortPy aims to accelerate research
15+
in this interdisciplinary field by offering **tools**, **baseline algorithms**, and **benhcmark datasets**.
816

9-
<div align="center">
10-
<img src="https://raw.githubusercontent.com/your-org/portpy/main/assets/logo.png" alt="PortPy Logo" width="180"/>
11-
</div>
1217

13-
---
1418

15-
## 🚀 Features
19+
## 🚀 Main Features
1620

17-
- **Intuitive API** for portfolio construction and optimization
18-
- **Interactive visualizations** for risk and return analysis
19-
- **Jupyter notebook support** for reproducible research
20-
- **Extensive documentation** and real-world examples
21+
- **IMRT/VMAT Planning Optimization (including AI):**
22+
Includes support for IMRT fluence map optimization and leaf sequencing (see [notebook](https://github.com/PortPy-Project/PortPy/blob/master/examples/1_basic_tutorial.ipynb)),
23+
VMAT direct aperture optimization
24+
(see [notebook](https://github.com/PortPy-Project/PortPy/blob/master/examples/vmat_scp_tutorial.ipynb)),
25+
AI-based dose-prediction IMRT
26+
(see [notebook](https://github.com/PortPy-Project/PortPy/blob/master/examples/imrt_dose_prediction.ipynb))
27+
and VMAT (see [notebook](https://github.com/PortPy-Project/PortPy/blob/master/examples/vmat_scp_dose_prediction.ipynb)) planning.
2128

22-
---
29+
- **Integration with Commercial TPS:**
30+
PortPy outputs IMRT/VMAT plans in DICOM-RT format which can be exported into commercial TPSs
31+
(see [notebook](https://github.com/PortPy-Project/PortPy/blob/master/examples/vmat_tps_import.ipynb)). For Eclipse TPS users:
32+
- PortPy outputs IMRT optimal fluence maps in an Eclipse-compatible format (see [notebook](https://github.com/PortPy-Project/PortPy/blob/master/examples/imrt_tps_import.ipynb)).
33+
- It supports automated data extraction (e.g., beamlets, voxels, dose influence matrix)
34+
from Eclipse via its scripting API in a PortPy-compatible format (see [notebook](https://github.com/PortPy-Project/PortPy/blob/master/examples/eclipse_photon_dose_calculation.ipynb)).
2335

24-
## Get Started
36+
- **Benchmark Datasets:**
37+
Provides access to a curated dataset of **100 lung cancer patients** with all necessary components for treatment planning optimization
38+
(beamlet, voxel, pre-computed dose influence matrix). IMRT plans generated using our in-house automated planning
39+
system, **ECHO**, are included for benchmarking
2540

26-
- [Installation Guide](installation.md)
27-
- [Quickstart Tutorial](quickstart.md)
28-
- [API Reference](reference/)
29-
- [GitHub Repository](https://github.com/your-org/portpy)
41+
- **Globally Optimal IMRT/VMAT Plans:**
42+
Implements slow but exact algorithms (e.g., Mixed-Integer Programming) to compute globally optimal plans, useful for benchmarking and validating heuristic algorithms.
3043

31-
---
3244

33-
## Why PortPy?
45+
## 📢 News
46+
- **[PortPy v1.1.0 released]** The following features have been added:
47+
48+
- **Eclipse users can use their own dataset**: For more info, see [notebook](https://github.com/PortPy-Project/PortPy/blob/master/examples/eclipse_photon_dose_calculation.ipynb).
49+
- **Lung benchmark dataset expanded**: Lung dataset expanded to 100 patients and is now hosted on [HuggingFace](https://huggingface.co/datasets/PortPy-Project),
50+
making it easier to access and use them in your research (see [notebook](https://github.com/PortPy-Project/PortPy/blob/master/examples/1_basic_tutorial.ipynb)).
51+
- **VMAT column generation algorithm added**: It finds a "warm start"
52+
(i.e., good but not neceassirily optimal) solution quickly for the current VMAT SCP (Sequential Convex Programming) optimization algorithm (see [notebook](https://github.com/PortPy-Project/PortPy/blob/master/examples/vmat_scp_tutorial.ipynb)).
53+
- **Enhanced visualization**: The evaluation table has been improved for better readability and analysis (see [notebook](https://github.com/PortPy-Project/PortPy/blob/master/examples/1_basic_tutorial.ipynb)).
3454

35-
- Built for both beginners and professionals
36-
- Actively maintained and open source
37-
- Integrates seamlessly with the Python data science stack
55+
[//]: # ()
56+
[//]: # (## 🚀 Key Components: Benchmark Datasets, Baseline Algorithms, and PortPy Toolkit)
3857

39-
---
58+
[//]: # ()
59+
[//]: # (<img src="./images/AI_Pyramid.png" align="right" alt="Radiotherapy 101" width="50%" height="40%">)
4060

41-
<div align="center">
42-
<a href="quickstart.md"><b>Start Optimizing Your Portfolio →</b></a>
43-
</div>
61+
[//]: # ( )
62+
[//]: # (This pyramid figure illustrates the inspiration behind developing PortPy, drawing from )
63+
64+
[//]: # (successful open-source practices in the AI and computer science communities. )
65+
66+
[//]: # (Tools like PyTorch and TensorFlow, along with benchmark datasets such as )
67+
68+
[//]: # (ImageNet and algorithms like AlexNet, have revolutionized AI and data science. )
69+
70+
[//]: # (Our goal is to replicate this successful model in the field of radiotherapy by )
71+
72+
[//]: # (equipping researchers with PortPy toolkit, benchmark algorithms, and datasets, )
73+
74+
[//]: # (as outlined below:)
75+
76+
[//]: # ()
77+
[//]: # (1. **PortPy Toolkit**. A set of python classes and functions allowing users to load the data, )
78+
79+
[//]: # (generate IMRT/VMAT plans, and evaluate/visualize the results. For more info, see our Jupyter Notebooks [basic_tutorial]&#40;&#41;)
80+
81+
[//]: # (2. **Benchmark Datasets**. We have curated and made publicly available a dataset of 100 lung cancer patients,)
82+
83+
[//]: # (which includes all the necessary data for treatment plan optimization &#40;e.g., beamlets, voxels, pre-computed dose influence matrix&#41;. )
84+
85+
[//]: # (These data are extracted from the commercial Eclipse treatment planning system using its API. Using your own data is currently only supported for Eclipse TPS users. For more info, see our Jupyter Notebooks &#40;[eclipse_photon_dose_calculation]&#40;https://github.com/PortPy-Project/PortPy/blob/master/examples/eclipse_photon_dose_calculation.ipynb&#41;)
86+
87+
[//]: # (3. **Baseline Algorithms**. This includes two sets of algorithms: 1&#41; fast algorithms that can generate IMRT/VMAT plans within the clinical time-frame &#40;in oder of minutes/hours&#41;,)
88+
89+
[//]: # (2&#41; slow algorithms that can generate globally optimal plans for benchmaking purposes. These plans could take weeks to generate and often involve some simplistic assumptions &#40;e.g., ignoring plan delivery efficiency in VMAT&#41;.)
90+
91+
[//]: # ()
92+
[//]: # (> Modern Portfolio Optimization in Python)
93+
94+
[//]: # ()
95+
[//]: # (---)
96+
97+
[//]: # (Test7)
98+
99+
[//]: # (Welcome to **PortPy**! Effortlessly optimize, analyze, and visualize your investment portfolios with a modern, user-friendly Python library.)
100+
101+
[//]: # ()
102+
[//]: # (<div align="center">)
103+
104+
[//]: # ( <img src="https://raw.githubusercontent.com/your-org/portpy/main/assets/logo.png" alt="PortPy Logo" width="180"/>)
105+
106+
[//]: # (</div>)
107+
108+
[//]: # ()
109+
[//]: # (---)
110+
111+
[//]: # ()
112+
[//]: # ()
113+
[//]: # ()
114+
[//]: # (---)
115+
116+
[//]: # ()
117+
[//]: # (## Get Started)
118+
119+
[//]: # ()
120+
[//]: # (- [Installation Guide]&#40;installation.md&#41;)
121+
122+
[//]: # (- [Quickstart Tutorial]&#40;quickstart.md&#41;)
123+
124+
[//]: # (- [API Reference]&#40;reference/&#41;)
125+
126+
[//]: # (- [GitHub Repository]&#40;https://github.com/your-org/portpy&#41;)
127+
128+
[//]: # ()
129+
[//]: # (---)
130+
131+
[//]: # ()
132+
[//]: # (---)
133+
134+
[//]: # ()
135+
[//]: # (<div align="center">)
136+
137+
[//]: # ( <a href="quickstart.md"><b>Start Optimizing Your Portfolio →</b></a>)
138+
139+
[//]: # (</div>)
44140

docs/installation.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/quick_start.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
## Installation
2+
1. **Using pip**:
3+
4+
* Run the command
5+
```
6+
pip install portpy
7+
```
8+
* You can install optional packages using
9+
```
10+
pip install portpy[mosek, pydicom]
11+
```
12+
* For installing AI related packages
13+
```
14+
pip install portpy[ai]
15+
```
16+
* For installing all the additional packages
17+
```
18+
pip install portpy[all]
19+
```
20+
21+
2. **From source**:
22+
23+
* Clone this repository using
24+
```
25+
git clone https://github.com/PortPy-Project/PortPy.git
26+
```
27+
* Navigate to the repository with
28+
```
29+
cd portpy
30+
```
31+
32+
* Install the dependencies within a Python virtual environment or Anaconda environment. To set up in a Python virtual environment, install all the dependencies specified in requirements.txt as follows:
33+
* Create the virtual environment with
34+
```
35+
python3 -m venv venv
36+
```
37+
* Activate the environment with
38+
```
39+
source venv/bin/activate
40+
```
41+
* Install the requirements using
42+
```
43+
pip install -r requirements.txt
44+
```
45+
46+
47+
## Quick Start Guide
48+
49+
50+
The easiest way to start is through the PorPy following Jupiter Notebook examples.
51+
52+
| Example File | Description |
53+
|------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
54+
| [1_basic_tutorial.ipynb](https://github.com/PortPy-Project/PortPy/blob/master/examples/1_basic_tutorial.ipynb) | Demonstrates the main functionalities of PortPy (e.g., Access data, create an IMRT plan, visualize) |
55+
| [eclipse_photon_dose_calculation.ipynb](https://github.com/PortPy-Project/PortPy/blob/master/examples/eclipse_photon_dose_calculation.ipynb) | Demonstrates the capability of running dose calculation for patients outside PortPy dataset using Varian's photon dose calculation module and perform optimization in PortPy |
56+
| [vmat_scp_tutorial.ipynb](https://github.com/PortPy-Project/PortPy/blob/master/examples/vmat_scp_tutorial.ipynb) | Creates a VMAT plan using sequential convex programming |
57+
| [vmat_scp_dose_prediction.ipynb](https://github.com/PortPy-Project/PortPy/blob/master/examples/vmat_scp_dose_prediction.ipynb) | Predicts 3D dose distribution using deep learning and converts it into a deliverable VMAT plan |
58+
| [3d_slicer_integration.ipynb](https://github.com/PortPy-Project/PortPy/blob/master/examples/3d_slicer_integration.ipynb) | Creates an IMRT plan and visualizes it in 3D-Slicer |
59+
| [imrt_tps_import.ipynb](https://github.com/PortPy-Project/PortPy/blob/master/examples/imrt_tps_import.ipynb) | 1. Outputs IMRT plan in DICOM RT format and imports it into TPS. <br>2. Outputs IMRT plan optimal fluence in an Eclipse-compatable format and imports it into Eclipse |
60+
| [vmat_tps_import.ipynb](https://github.com/PortPy-Project/PortPy/blob/master/examples/vmat_tps_import.ipynb) | Outputs VMAT plan in DICOM RT format and imports it into TPS |
61+
| [imrt_dose_prediction.ipynb](https://github.com/PortPy-Project/PortPy/blob/master/examples/imrt_dose_prediction.ipynb) | Predicts 3D dose distribution using deep learning and converts it into a deliverable IMRT plan |
62+
| [vmat_global_optimal.ipynb](https://github.com/PortPy-Project/PortPy/blob/master/examples/vmat_global_optimal.ipynb) | Finds a globally optimal VMAT plan |
63+
| [beam_orientation_global_optimal.ipynb](https://github.com/PortPy-Project/PortPy/blob/master/examples/beam_orientation_global_optimal.ipynb) | Finds globally optimal beam angles for IMRT |
64+
| [dvh_constraint_global_optimal.ipynb](https://github.com/PortPy-Project/PortPy/blob/master/examples/dvh_constraint_global_optimal.ipynb) | Finds a globally optimal plan meeting Dose Volume Histogram (DVH) constraints |

docs/resources.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Additional learning materials, tutorials, and external tools will be added here soon.
2+
Stay tuned!

docs/styles/extra.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
/* docs/extra.css */
22

3+
/* Top-level menu items — with or without submenus */
4+
.md-nav__list > .md-nav__item > .md-nav__link {
5+
font-weight: bold;
6+
font-size: 1.05em;
7+
padding-left: 0.5em;
8+
}
9+
10+
/* Sub-menu items */
11+
.md-nav__item--nested .md-nav__item .md-nav__link {
12+
font-weight: normal;
13+
font-size: 0.95em;
14+
padding-left: 1.5em;
15+
}
16+
317
.md-sidebar {
418
/* width: 210px !important; Adjust this value to your liking */
519
/*min-width: 180px !important; Prevents being too small on resize */

0 commit comments

Comments
 (0)