opencvfun / TMO4CT

Tone mapping for CT images

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tone mapping for CT images

Travis:Build Status Coveralls:Coverage Status Codecov:codecov

pyversion PyPI - License DOI

The primary aim was to develop a simple and effective tone mapping for CT images. The exact details are published in this article: UNDER PROCESSING (will be updated when the paper is published).

The code is implemented in Python3, and requires Python3.5 or newer. For higher execution speed, Numba is used. However, sometimes Numba can be quite difficult to install, therefore, it is not a strict requirement, and the code is able to run without Numba too, but with a significantly lower speed.

Installation

The code could be installed directly from Github:

pip install git+https://github.com/dvolgyes/TMO4CT

or cloning the directory, or installed from PyPI:

pip install TMO4CT

The code and the paper about it are currently under review. PyPI is a bit strict about publishing the same version only once. Until the paper is not accepted, the version number is smaller than 1.0, and the code is not deposited elsewhere than PyPI, github (and the journal). After publication, the version will be bumped to 1.0, and the code will be deposited at https://zenodo.org.

Usage

Aftern installation, the command line options can be queried:

TMO4CT_cli.py -h

The code could be used as a library too.

Examples

Examples are presented in the 'examples' directory. The code is able to process color images, however, it only works on the lightness/brightness/luminosity/etc. channel, and leaves the colors intact. The reason originates in the scope. The primary aim was to enhance CT visualization. There are many tone mapping operators for color photography, and some of them takes color appearance very seriously, producing nice tone mapped HDR images. CTs are grayscale images, and different from regular photos. This algorithm is not meant to replace regular tone mapping operators, but to give an alternative for CT images.

Anyway, regular photos are usually more understandable for human beings than CT images, and it is a great way to demonstrate the advantages and pitfalls. For instance, the small, hidden details are much more visible in the tone mapped version, but image noise, hidden staircasing could be highlighted if the enhancement is too strong.

Original Tone mapped

Remarks

The code expects 16bit tiff or png files, but most CT files are stored in DICOM. DICOM conversion is a but challenging, but there is a convenient tool for this very task: dcm2hdr.

It is simple:

dcm2hdr.py INPUT_FILE OUTPUT_FILE

For more details, visit dcm2hdr's website: https://github.com/dvolgyes/dcm2hdr

Issues

If you have any issue to report, please use Github's issue tracker.

About

Tone mapping for CT images

License:GNU Affero General Public License v3.0


Languages

Language:Python 94.6%Language:Makefile 5.4%