Metadata-Version: 2.4
Name: dcm-colmap
Version: 0.0.2
Summary: DICOM colormaps for matplotlib.
Project-URL: Homepage, https://github.com/carlvillads/dcm-colmap
Project-URL: Repository, https://github.com/carlvillads/dcm-colmap.git
Author-email: Carl Villads Priisholm <me@cvrp.dk>
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Keywords: colormap,dicom,matplotlib,medical-imaging,nuclear-medicine,pet
Classifier: Intended Audience :: Healthcare Industry
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.11
Requires-Dist: matplotlib>=3.8
Requires-Dist: numpy>=1.25
Description-Content-Type: text/markdown

# dcm-colmap

Matplotlib implementation of the DICOM colormaps defined in [NEMA DICOM PS3.6, Annex B](https://dicom.nema.org/medical/dicom/2017c/output/chtml/part06/chapter_B.html)

## Available colormaps

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

## Install

```bash
pip install dcm-colmap
```

## Usage

Get a `Colormap` instance directly:

```python
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:

```python
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()
```
