dcmrtstruct2nii
DICOM RT-Struct to nii-mask. This is a naïve approach to rasterizing rt-struct to masks in nii format. If there's holes in your RT-Struct then this approach will most likely not work. The RT-Struct needs to be within the bounds of the slices of the original DICOM. Rasterization is done on a slice-by-slice basis, interpolation between slices is currently unsupported.
Rasterization
Currently the RT-Struct is treated as a polygon and is rasterized trough this function on a slice-by-slice basis. We'll hapilly add other rasterization algorithms (e.g. ones that can deal with holes in the polygon) if you point us to some code to do that or if you send in a pull request.
Interpolation
Interpolation of the mask between slices is currently unsupported. Send us an algorithm or a pull requests and we'll happly add it.
Input file format
The DICOM and RT-Struct inputs need to be unzipped in a directory. Currently this is the only way to read the input files.
CLI Tool
# install using pip and show tool help
pip install dcmrtstruct2nii
dcmrtstruct2nii --help
# list structures in DICOM RT Struct
dcmrtstruct2nii list -r /path/to/rtstruct/file
# convert help output
dcmrtstruct2nii convert --help
# convert DICOM RT Structs to .nii.gz masks
dcmrtstruct2nii convert -r /path/to/rtstruct/file.dcm -d /path/to/original/extracted/dicom -o /output/path
Python API
# install using pip and show tool help
pip install dcmrtstruct2nii
# lets test it
from dcmrtstruct2nii import dcmrtstruct2nii, list_rt_structs
print(list_rt_structs('/path/to/dicom/rtstruct/file.dcm'))
dcmrtstruct2nii('/path/to/dicom/rtstruct/file.dcm', '/path/to/original/extracted/dicom/files', '/output/path')
License and academic use
The program is licensed Apache license 2.0.
For academic use, use a presistent copy from .
Please cite:
Phil, T. (2020). Sikerdebaard/dcmrtstruct2nii: v1.0.19 (v1.0.19) [Computer software]. Zenodo. https://doi.org/10.5281/ZENODO.4037865
Metadata
Release files for dcmrtstruct2nii 1.0.19
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dcmrtstruct2nii-1.0.19.tar.gz | 9.3 kB | Without provenance | Details |
Release files / dcmrtstruct2nii-1.0.19.tar.gz
| Download URL | dcmrtstruct2nii-1.0.19.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
12dfe7af11926a49ba02ed8207be4f6d3c6638169c8a723aeb650ff4c09f77a1
|
|
BLAKE2b-256 checksum How to use checksums |
31bf381bbf9d03f69f4431f69efc69a616abc4cceffea0ad5e09c3a0060c1235
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.8
|
Security for dcmrtstruct2nii 1.0.19
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.