dicompyler / dicompyler-core

A library of core radiation therapy modules for DICOM RT used by dicompyler
https://dicompyler-core.readthedocs.io
Other
147 stars 69 forks source link
dicom dicom-rt dvh hacktoberfest python radiation-oncology radiation-physics

dicompyler-core

|Binder| |pypi| |Python Version| |GH Actions| |Documentation Status| |coveralls| |Codacy| |Codecov| |Total Lines| |Code Size| |Zenodo|

A library of core radiation therapy modules for DICOM / DICOM RT used by dicompyler <http://www.dicompyler.com>__. This package includes:

Other information

Dependencies

Basic Usage

.. code-block:: python

from dicompylercore import dicomparser, dvh, dvhcalc
dp = dicomparser.DicomParser("rtss.dcm")

# i.e. Get a dict of structure information
structures = dp.GetStructures()

>>> structures[5]
{'color': array([255, 128, 0]), 'type': 'ORGAN', 'id': 5, 'empty': False, 'name': 'Heart'}

# Access DVH data
rtdose = dicomparser.DicomParser("rtdose.dcm")
heartdvh = dvh.DVH.from_dicom_dvh(rtdose.ds, 5)

>>> heartdvh.describe()
Structure: Heart
DVH Type:  cumulative, abs dose: Gy, abs volume: cm3
Volume:    437.46 cm3
Max Dose:  3.10 Gy
Min Dose:  0.02 Gy
Mean Dose: 0.64 Gy
D100:      0.00 Gy
D98:       0.03 Gy
D95:       0.03 Gy
D2cc:      2.93 Gy

# Calculate a DVH from DICOM RT data
calcdvh = dvhcalc.get_dvh("rtss.dcm", "rtdose.dcm", 5)

>>> calcdvh.max, calcdvh.min, calcdvh.D2cc
(3.0899999999999999, 0.029999999999999999, dvh.DVHValue(2.96, 'Gy'))

Advanced Usage and Examples can be found in Binder: |Binder|

Citing dicompyler-core

A DOI for dicompyler-core with various citation styles can be found at Zenodo: |Zenodo|

Credits

This package was created with Cookiecutter <https://github.com/audreyr/cookiecutter> and the audreyr/cookiecutter-pypackage <https://github.com/audreyr/cookiecutter-pypackage> project template.

.. |Binder| image:: http://mybinder.org/badge.svg :target: http://mybinder.org/repo/bastula/dicom-notebooks .. |pypi| image:: https://img.shields.io/pypi/v/dicompyler-core.svg :target: https://pypi.python.org/pypi/dicompyler-core .. |Python Version| image:: https://img.shields.io/badge/python-3.7+-blue.svg :target: https://pypi.python.org/pypi/dicompyler-core .. |GH Actions| image:: https://github.com/dicompyler/dicompyler-core/actions/workflows/build.yml/badge.svg :target: https://github.com/dicompyler/dicompyler-core/actions .. |Documentation Status| image:: https://readthedocs.org/projects/dicompyler-core/badge/?version=latest :target: https://dicompyler-core.readthedocs.io/en/latest/ .. |coveralls| image:: https://coveralls.io/repos/github/dicompyler/dicompyler-core/badge.svg?branch=master :target: https://coveralls.io/github/dicompyler/dicompyler-core?branch=master .. |Codacy| image:: https://api.codacy.com/project/badge/Grade/27ebb3802baf4d96b0783a2ae5904264 :target: https://app.codacy.com/gh/dicompyler/dicompyler-core/dashboard .. |Codecov| image:: https://codecov.io/gh/dicompyler/dicompyler-core/branch/master/graph/badge.svg :target: https://codecov.io/gh/dicompyler/dicompyler-core .. |Total Lines| image:: https://img.shields.io/tokei/lines/github/dicompyler/dicompyler-core :target: https://img.shields.io/tokei/lines/github/dicompyler/dicompyler-core .. |Code Size| image:: https://img.shields.io/github/languages/code-size/dicompyler/dicompyler-core :target: https://img.shields.io/github/languages/code-size/dicompyler/dicompyler-core .. |Zenodo| image:: https://zenodo.org/badge/51550203.svg :target: https://zenodo.org/badge/latestdoi/51550203