dicompyler: Open-Source DICOM RT Viewer for Radiation Therapydicompyler is a free, open-source DICOM RT (Radiation Therapy) viewer focused on providing clinicians, medical physicists, dosimetrists, and researchers with tools to review radiotherapy imaging, structures, plans, and dose distributions. Built in Python and released under permissive open-source licensing, dicompyler aims to make radiotherapy data inspection and quality assurance accessible without the cost or restrictions of commercial software.
Background and purpose
Radiation therapy relies on accurate imaging, target and organ-at-risk delineation, treatment planning, and dose verification. DICOM RT (Digital Imaging and Communications in Medicine — Radiation Therapy) defines a set of specialized objects (RTSTRUCT, RTPLAN, RTDOSE, RTIMAGE) that store structure contours, beam parameters, dose grids, and related metadata. While many commercial treatment planning systems include integrated viewers, there is a strong need for independent tools for plan review, research, teaching, and secondary QA. dicompyler fills this niche by offering a standalone viewer that reads DICOM RT objects, displays anatomy and dose, and calculates dose–volume histograms (DVHs).
Key features
- Cross-platform: runs on Windows, macOS, and Linux.
- DICOM RT support: reads RTSTRUCT, RTPLAN, RTDOSE, and standard CT/MR image series.
- Dose visualization: overlay dose colorwash on CT slices, with adjustable window/level and color maps.
- DVH calculation: generate dose–volume histograms for structures, exportable for analysis.
- Isodose lines and dose statistics: display isodose contours and compute structure dose metrics (Dmax, Dmean, Vx, Dx).
- Plan and beam inspection: view beam geometry, control points, and basic MU information.
- Plugin and scripting-friendly: built in Python, allowing extension and integration into QA workflows.
- Lightweight GUI and command-line tools for batch processing.
- Open-source: source code available on public repositories for transparency and community contributions.
Typical workflows
-
Loading data:
- Import a DICOM series containing CT (or MRI), RTSTRUCT, RTPLAN, and RTDOSE files.
- dicompyler parses the DICOM tags and organizes images, structures, and dose grids.
-
Visual inspection:
- Navigate axial/coronal/sagittal slices; toggle structure overlays and dose wash.
- Adjust dose color mapping, opacity, and slice interpolation to inspect dose distribution relative to targets and organs-at-risk.
-
Quantitative QA:
- Generate DVHs for selected structures; compute D95, D98, D2, mean dose, and volume-based metrics (V20, V30, etc.).
- Compare planned vs delivered dose distributions if measured dose data (e.g., from RTDOSE or secondary calculation) are available.
-
Reporting/export:
- Export DVHs and dose statistics as CSV or other formats for inclusion in QA reports.
- Save screenshots or DICOM RTSTRUCT/RTDOSE subsets for sharing with colleagues.
Strengths and appropriate use cases
- Independent QA and peer review: dicompyler provides a second look at plans produced by treatment planning systems, useful for catch errors or for second-opinion review.
- Education and training: accessible interface and open code base make it suitable for teaching concepts like DVH interpretation, isodose visualization, and plan evaluation.
- Research and prototyping: Python implementation allows researchers to integrate dicompyler components into custom analysis pipelines or to prototype new visualization tools.
- Low-resource settings: being free and lightweight, it’s attractive for clinics or institutions with limited budgets or where purchasing commercial viewers is infeasible.
Limitations and cautions
- Not a treatment planning system (TPS): dicompyler is an inspection and QA tool. It is not intended to create treatment plans, perform clinical dose calculations for patient care decisions, or replace a certified TPS.
- Simplified modeling: some advanced TPS features (e.g., heterogeneity corrections, complex beam modeling, MLC sequencing specifics) are not reproduced with clinical accuracy in dicompyler.
- Regulatory considerations: clinical use that affects patient care should rely on validated, regulatory-approved systems. Use dicompyler for independent review, education, and research, not as the primary source for treatment decisions.
- Support and documentation: as an open-source project, level of support depends on community activity; documentation may be less polished than commercial offerings.
Installing and getting started
Primary installation methods include pip for Python users and platform-specific installers when available. Typical steps:
- Ensure Python (commonly 3.7+) is installed.
- Install via pip:
pip install dicompyler
- Launch the GUI or use command-line utilities to load DICOM folders.
For users preferring prebuilt packages, check project releases for Windows/macOS executables or platform-specific installers. Always verify compatibility with your Python environment and DICOM data.
Extending dicompyler and integration
Because dicompyler is written in Python, it’s relatively straightforward to:
- Script batch DVH extraction across patient cohorts.
- Integrate dicompyler parsing routines into research pipelines for dosimetric analysis.
- Add plugins or contribute to the codebase to support new dose visualizations or DICOM tags.
Developers commonly use libraries like pydicom and numpy alongside dicompyler components to manipulate DICOM files and compute metrics.
Example: generating a DVH (conceptual)
Load the RTDOSE and RTSTRUCT objects, resample dose grid to structure geometry if needed, compute dose for voxels inside the structure, then create a histogram of dose values normalized to prescription dose. Export as CSV for statistical analysis.
Community and development
dicompyler is maintained on public version-control platforms where users can file issues, request features, and contribute code. Community involvement is central: bug reports, pull requests, and documentation updates help the project improve.
Conclusion
dicompyler is a valuable open-source tool for visualizing and performing independent QA of DICOM RT datasets. It’s well-suited for education, research, and secondary plan review, offering dose visualization, DVH computation, and a scriptable Python codebase. While it should not replace certified treatment planning systems for clinical decision-making, its accessibility and transparency make it a useful part of radiotherapy workflows and quality-assurance toolkits.
Leave a Reply