Datasets:

Modalities:
Text
Formats:
json
Languages:
English
Size:
< 1K
Libraries:
Datasets
pandas
License:
PortPy_Dataset / README.md
PortPy's picture
Update README.md
f6c87b5 verified
|
raw
history blame
9.92 kB
metadata
license: cc-by-nc-3.0
language:
  - en
size_categories:
  - 10B<n<100B
configs:
  - config_name: default
    data_files:
      - split: train
        path: data_info.jsonl

license: apache-2.0 language: - en size_categories: - 10B<n<100B configs: - config_name: default data_files: - split: train path: data_info.jsonl

PortPy: Planning and Optimization for Radiation Therapy

Data Overview

PortPy equips researchers with a robust benchmark patient dataset, sourced from the FDA-approved Eclipse commercial treatment planning system through its API. This dataset embodies all necessary elements for optimizing various machine configurations such as beam angles, aperture shapes, and leaf movements. It includes

  1. Dose Influence Matrix (AKA dose deposition matrix, dij matrix): The dose contribution of each beamlet to each voxel,
  2. Beamlets/Voxels Details: Detailed information about the position and size of beamlets/voxels,
  3. Expert-Selected Benchmark Beams: An expert clinical physicist has carefully selected benchmark beams, providing reference beams for comparison and benchmarking,
  4. Benchmark IMRT Plan: A benchmark IMRT plan generated using our in-house automated treatment planning system called ECHO (YouTube Video, Paper). This plan serves as a benchmark for evaluating new treatment planning algorithms.
  5. Benchmark Clinical Criteria: A set of clinically relevant mean/max/DVH criteria for plan evaluation. Currently, this set encompasses only the Lung 2Gy×30 protocol but will be expanded in the future to more protocols as well as TCP/NTCP evaluation functions.

Subsequently, create a directory titled './data' in the current project directory and transfer the downloaded file into it. For example, ./data/Lung_Phantom_Patient_1. We have adopted the widely-used JSON and HDF5 formats for data storage. HDFViwer can be utilized to view the contents of the HDF5 files.

Note: Initially, we will utilize a lung dataset from TCIA. The original DICOM CT images and structure sets are not included in the PortPy dataset and need to be directly downloaded from the TCIA. Users can fetch the TCIA collection ID and the TCIA subject ID for each PortPy patient using the get_tcia_metadata() method in PortPy and subsequently download the data from TCIA (see imrt_tps_import)

Data Fields

Each beam is divided into small 2D beamlets/spots, and the patient’s body is divided into small 3D voxels. Eclipse is used to calculate the dose contribution of each beamlet to every voxel, resulting in a dose influence matrix (also called a dose deposition matrix or dij matrix). Relevant beamlet and voxel information (e.g., size, coordinates) is stored, as well as CT data (e.g., voxel Hounsfield Units, coordinates) and structure data (e.g., structure names, masks).

The scripts adopt the data format, where:

  • Light-weight metadata is stored in human-readable .json files.

  • Large datasets (e.g., dose influence matrices) are stored in .h5 (HDF5) files.

A typical output folder structure for a patient might look like this:

│
├── Beams/
│   ├── Beam_0_MetaData.json
│   ├── Beam_0_Data.h5
│   ├── Beam_1_MetaData.json
│   ├── Beam_1_Data.h5
├── CT_Data.h5
├── CT_MetaData.json
└── StructureSet_MetaData.json
└── StructureSet_Data.h5

Example JSON and HDF5 Files

Beam_0_metadata.json

Below is an example .json file for a beam. Notice how the larger data arrays (e.g., beamlets, influence matrices) point to external .h5 files with specific tags. For instance, "influenceMatrixSparse_File": "Beam_0_Data.h5/inf_matrix_sparse", means the influence matrix is stored in a file named Beam_0_Data.h5 under a tag named inf_matrix_sparse.

{
  "ID": 0,
  "gantry_angle": 0,
  "collimator_angle": 0,
  "couch_angle": 0,
  "iso_center": {
    "x_mm": 119.2041,
    "y_mm": 60.53891,
    "z_mm": -9.122542
  },
  "beamlets": {
    "id_File": "Beam_0_Data.h5/beamlets/id",
    "width_mm_File": "Beam_0_Data.h5/beamlets/width_mm",
    "height_mm_File": "Beam_0_Data.h5/beamlets/height_mm",
    "position_x_mm_File": "Beam_0_Data.h5/beamlets/position_x_mm",
    "position_y_mm_File": "Beam_0_Data.h5/beamlets/position_y_mm",
    "MLC_leaf_idx_File": "Beam_0_Data.h5/beamlets/MLC_leaf_idx"
  },
  "jaw_position": {
    "top_left_x_mm": -5,
    "top_left_y_mm": 40,
    "bottom_right_x_mm": 97.5,
    "bottom_right_y_mm": -60
  },
  "influenceMatrixSparse_File": "Beam_0_Data.h5/inf_matrix_sparse",
  "influenceMatrixFull_File": "Beam_0_Data.h5/inf_matrix_full",
  "MLC_leaves_pos_y_mm_File": "Beam_0_Data.h5/MLC_leaves_pos_y_mm"
}
Beam_0_Data.h5

HDF5 (Hierarchical Data Format version 5) is a common and powerful format that is supported by most programming languages. It is designed to store and organize large amounts of complex data using a flexible, hierarchical structure, allowing efficient access, compression, and storage of multidimensional arrays. The following example shows the hierarchical data for a beam. HDFViwer can be used to see through a .h5 file.

Beam_0_Data.h5
│
├── beamlets/
│   ├── id               (1D array of beamlet IDs)
│   ├── width_mm         (1D array of beamlet widths in mm)
│   ├── height_mm        (1D array of beamlet heights in mm)
│   ├── position_x_mm    (1D array of x positions in mm)
│   ├── position_y_mm    (1D array of y positions in mm)
│   └── MLC_leaf_idx     (1D array of MLC leaf indices)
│
├── inf_matrix_sparse    (Sparse influence matrix)
├── inf_matrix_full      (Full influence matrix)
└── MLC_leaves_pos_y_mm (MLC leaves positions in mm in y direction)

How to use it

You can load the dataset with the following two lines of code.

from datasets import load_dataset

dataset = load_dataset("PortPy-Project/PortPy_Datset", split="split_0")
print(dataset)
Dataset({
    features: ['patient_id', 'ct_data', 'ct_metadata', 'structureset_data', 'structureset_metadata', 'beam_data_paths', 'beam_metadata_paths', 'optimization_voxels_data', 'optimization_voxels_metadata', 'planner_beams', 'rt_dose_echo_imrt', 'rt_plan_echo_imrt'],
    num_rows: 50
})

# load ct metadata for 1st patient
ct_metadata = load_dataset("json", data_files=dataset[0]['ct_metadata'])
print(ct_metadata)

DatasetDict({
    train: Dataset({
        features: ['origin_xyz_mm', 'resolution_xyz_mm', 'size_xyz_mm', 'direction', 'ct_hu_3d_File'],
        num_rows: 1
    })
})

# load ct metadata for 1st patient
structureset_metadata = load_dataset("json", data_files=dataset[0]['structureset_metadata'])
print(structureset_metadata)

DatasetDict({
    train: Dataset({
        features: ['name', 'volume_cc', 'dicom_structure_name', 'fraction_of_vol_in_calc_box', 'structure_mask_3d_File'],
        num_rows: 9
    })
})

Team

PortPy is a community project initiated at Memorial Sloan Kettering Cancer Center (MSK). It is currently developed and maintained by Masoud Zarepisheh (Principal Investigator, zarepism@mskcc.org) and Gourav Jhanwar (Lead Developer, jhanwarg@mskcc.org). Other team members include: Mojtaba Tefagh (Optimization/AI/ML expert from University of Edinburgh), Linda Hong (Medical Physicist from MSK), Vicki Taasti (Proton Physicist from Aarhus University), and Saad Nadeem (AI/Imaging expert from MSK).

Attribution

This dataset is derived from the publicly available NSCLC-Radiomics dataset hosted on The Cancer Imaging Archive (TCIA).

Original Data Citation: Aerts, H. J. W. L., Wee, L., Rios Velazquez, E., Leijenaar, R. T. H., Parmar, C., Grossmann, P., Carvalho, S., Bussink, J., Monshouwer, R., Haibe-Kains, B., Rietveld, D., Hoebers, F., Rietbergen, M. M., Leemans, C. R., Dekker, A., Quackenbush, J., Gillies, R. J., Lambin, P. (2014). Data From NSCLC-Radiomics (version 4) [Data set]. The Cancer Imaging Archive. https://doi.org/10.7937/K9/TCIA.2015.PF0M9REI

The original imaging data was processed by the authors of this repository by:

  • Adding beam configurations.
  • Creating influence matrices suitable for radiotherapy treatment planning.
  • Storing the data in the standardized PortPy data format for research and educational purposes.

These modifications are independent and TCIA is not responsible for any alterations made to the original data.

Reference

If you find our work useful in your research or if you use parts of this code please cite our AAPM'23 abstract :

@article{jhanwar2023portpy,
  title={Portpy: An Open-Source Python Package for Planning and Optimization in Radiation Therapy Including Benchmark Data and Algorithms},
  author={Jhanwar, Gourav and Tefagh, Mojtaba and Taasti, Vicki T and Alam, Sadegh R and Tuomaala, Seppo and Nadeem, Saad and Zarepisheh, Masoud},
  journal={AAPM 65th Annual Meeting & Exhibition},
  year={2023}
}