rwindsor1 / DICOMcat

A simple python-based tool based on imgcat for displaying DICOM files in iTerm2.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DICOMcat

DICOMcat is a simple, pip-installable python package for displaying DICOM files in iTerm2 similar to imgcat for conventional images and niicat for nifti images. This might be useful for quickly viewing DICOMs on a remote server in your terminal.

Installation

To use either pip install (pip install dicomcat) or clone the source code and add to your python path.

Usage

DICOMcat can be used, either within a python script or from the terminal

To use in terminal, navigate to the DICOM folder/file and enter

$ dicomcat EXAMPLE_FILE

In a python script, use as follows

import dicomcat path='path/to/dicom' dicomcat.dicomcat(path)

There are additional options to change the number of rows, downscaling, or maximum number of slices shown (when displaying a directory of DICOM slices).

Examples/Testing

There are a number of example DICOMS to test with the repo. To run the examples, run python -m unittest in the package directory

Example Dicom Sources:

  • LumbarDicomExample - Radiopedia.org, Case courtesy of Prof. Frank Galliard source
  • Head - Head CT, courtesy of Visual Human Project source
  • Knee - Knee CT, courtesy of Visual Human Project source
  • BrainExample - Brain MRI, courtesy of Jeff Mather, Mathworks source

Features to be added

The following are planned to be added in the fullness of time:

  • GIF view through slices instead of grid.
  • Adding handlers for compressed pixel data (for now, update your pydicom, see here
  • libsixel support for use with terminals other than iTerm2

If you'd like to contribute one of these or your own feature, feel free to submit a PR.

About

A simple python-based tool based on imgcat for displaying DICOM files in iTerm2.

License:MIT License


Languages

Language:Python 100.0%