Skip to main content

dicom-mask

Export structure from dicom to numpy binary mask

Why does this exist?

Dicom-mask was developed by the radiation-oncology research group at Rigshospitalet, Denmark.

We implemented dicom-mask because the existing DICOM export tools we found failed to extract the DICOM RTSTRUCT (1) information from our ViewRay DICOM files. dicom-mask contains code modified from dicompyler (2) and uses dicompyler-core (3) and scikit-image (4) to extract RTSTRUCT data into a NumPy (5) ndarray object.

Install

The latest version is available via PyPI (https://pypi.org/project/dicom-mask) for convenient installation with pip

pip install dicom-mask

Example usage

from dicom_mask.convert import struct_to_mask

dicom_dir = 'some_dicom_dir'
dicom_files = ['all', 'dicom', 'series', 'image', 'filenames', 'and', 'struct', 'filename']
struct_name = 'liver' 

mask = struct_to_mask(dicom_dir, dicom_files, struct_name)

Citation

The paper for which it was initially developed is:

Gating has a negligible impact on dose delivered in MRI-guided online adaptive radiotherapy of prostate cancer

Citing the above paper is best for us :)

For citation of the tool source code directly please cite the zenodo repository

Abraham George Smith. (2021). Abe404/dicom_mask: 0.0.17b (0.0.17b). Zenodo. https://zenodo.org/record/5727328

References

  1. Gorthi, Subrahmanyam & Bach Cuadra, Meritxell & Thiran, Jean-Philippe. (2009). Exporting Contours to DICOM-RT Structure Set.
  2. Panchal, Aditya, and Roy Keyes. "SU‐GG‐T‐260: dicompyler: an open source radiation therapy research platform with a plugin architecture." Medical Physics 37.6Part19 (2010): 3245-3245.
  3. Aditya Panchal, pyup.io bot, Gabriel Couture, gertsikkema, Nicolas Galler, Hideki_Nakamoto, David C Hall, & Akihisa Wakita. (2019). dicompyler/dicompyler-core v0.5.5 (v0.5.5). Zenodo. https://doi.org/10.5281/zenodo.3236628
  4. Stéfan van der Walt, Johannes L. Schönberger, Juan Nunez-Iglesias, François Boulogne, Joshua D. Warner, Neil Yager, Emmanuelle Gouillart, Tony Yu and the scikit-image contributors. scikit-image: Image processing in Python. PeerJ 2:e453 (2014) https://doi.org/10.7717/peerj.453
  5. Harris, C.R., Millman, K.J., van der Walt, S.J. et al. Array programming with NumPy. Nature 585, 357–362 (2020). DOI: 10.1038/s41586-020-2649-2. (Publisher link).

Metadata

Release files for dicom-mask 0.0.30

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dicom-mask 0.0.30
File Size Uploaded
dicom_mask-0.0.30.tar.gz 6.9 kB Details

Release files / dicom_mask-0.0.30.tar.gz

Download URL dicom_mask-0.0.30.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
43bd7aab7b774dbfc2fff9529c7e300c89bd840794aa378b57a9622aa008cdb3
BLAKE2b-256 checksum
How to use checksums
27f2b271713515ef53a3d032b228cc1998981ef5501c75e7f45101f44efbe79e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.5

Release history Release notifications | RSS feed

This release

0.0.30 This release

1 release file

0.0.29

1 release file

0.0.28

1 release file

0.0.27

1 release file

0.0.25

1 release file

0.0.24

1 release file

0.0.23

1 release file

0.0.22

1 release file

0.0.21

1 release file

0.0.20

1 release file

0.0.19

1 release file

0.0.18

1 release file

0.0.17

1 release file

0.0.16

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

2 release files

0.0.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page