dcm2hdr

DCM2HDR - DICOM to HDR (16bit TIFF/PNG) converter


Keywords
DICOM, HDR, TIFF, PNG
License
AGPL-3.0
Install
pip install dcm2hdr==1.1.1

Documentation

DCM2HDR: DICOM to HDR converter

Travis:Build Status Semaphore:Build Status CircleCI:Build status AppVeyor:Build status GitlabCI:gitlabci

Coveralls:Coverage Status Codecov:codecov Snyk:Known Vulnerabilities

pyversion PyPI - License DOI

This is a Python2/3 converter tool () which converts DICOM files to 16 bit PNG and TIFF files. The aim is to make it easier editing files with regular photo editor tools, e.g. for presentation. The PNG files are single channel grayscale files, the TIFFs are RGB encoded gray files (all channels have the same value).

Technically, there are several file formats for high bit depth images, e.g. Radiance HDR, OpenEXR, etc. However, 16bit seems to be enough, and these formats are more complicated than TIFF/PNG. If you need Radiance HDR/OpenEXR, and 16bit png is not enough, then open a ticket, and let me know.

The software is kind of trivial, you don't have to cite it, but if you want, then you could use DOI shield above, or query the latest reference from command line:

dcm2hdr.py --cite

The query will provide both plain text and BiBTeX information.

Source code

The code is hosted at Github and GitLab too, with the exact same content. However, on long term, the project will migrate to GitLab, so please, use the GitLab site: https://gitlab.com/dvolgyes/dcm2hdr

Install

pip install dcm2hdr

or directly from the git repository:

pip install git+https://gitlab.com/dvolgyes/dcm2hdr

Afterwards, you can query the command line options:

dcm2hdr -h

but the default settings should work for most use cases:

dcm2hdr.py DICOM_INPUT_FILE  PNG_or_TIFF_OUTPUT

URLs: I plan to add support to open dicom files directly from internet, but I do not guarantee this to work. Also, I rely on the dicom package from PyPi. If the DICOM format is not supported by this library, then I cannot do anything. (It is rare, but some scanner use compressed dicoms, encryption, etc. DCMTK/GDCM can handle most of the weird issues, so if you need to process such files, use DCMTK or GDCM to convert the source files to something more standard.)

Documentation

The tool itself is simple, the help message is reasonable:

dcm2hdr.py -h

but if you need more, open a github ticket and explain what is missing.

Issues

If you discover any issues, please open a ticket on Gitlab.