Skip to content

carlvillads/dcm-colmap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dcm-colmap

Matplotlib implementation of the DICOM colormaps defined in NEMA DICOM PS3.6, Annex B

Available colormaps

fall, hotiron, hotmetalblue, pet, pet20step, spring, summer, winter

Install

pip install dcm-colmap

Usage

Get a Colormap instance directly:

import matplotlib.pyplot as plt
import numpy as np
from dcmcolmap import get_colormap

gradient = np.linspace(0, 1, 256).reshape(1, -1)
plt.imshow(gradient, aspect="auto", cmap=get_colormap("pet"))
plt.show()

Or register every colormap with matplotlib under a dicom_ prefix so you can reference them by string name in matplotlib plots:

import matplotlib.pyplot as plt
import numpy as np
from dcmcolmap import register_all

register_all()

gradient = np.linspace(0, 1, 256).reshape(1, -1)
plt.imshow(gradient, aspect="auto", cmap="dicom_hotiron")
plt.show()

About

DICOM colormaps for matplotlib.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages