niivue / ipyniivue

A WebGL-powered Jupyter Widget for Niivue based on anywidget
BSD 2-Clause "Simplified" License
25 stars 8 forks source link

Add custom colormaps #31

Closed AnthonyAndroulakis closed 5 months ago

AnthonyAndroulakis commented 1 year ago

add ability to add custom colormaps (https://github.com/niivue/niivue/blob/fd1d35ce853b41e35860d67d1de6a847e47614d7/demos/features/colormaps.html#L45)

possible usage if implemented:

cmap = {
    "R": [0, 255, 22, 127],
    "G": [0, 20, 192, 187],
    "B": [0, 152, 80, 255],
    "A": [0, 255, 255, 255],
    "I": [0, 22, 222, 255],
  };
key = "Custom";
nv.add_colormap(key, cmap);