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.
To use either pip install (pip install dicomcat
) or clone the source code and add to your python path.
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).
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 sourceHead
- Head CT, courtesy of Visual Human Project sourceKnee
- Knee CT, courtesy of Visual Human Project sourceBrainExample
- Brain MRI, courtesy of Jeff Mather, Mathworks source
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.