brain_deer.presentation.colormap_registry

Preset and user-defined colormaps (persisted via QSettings).

Functions

get_colormap_lut(→ numpy.ndarray | None)

Return extended RGBA LUT for pyqtgraph (index 0 = transparent for masked -inf).

scalar_values_to_rgba(→ numpy.ndarray)

Colorize a 1D scalar array with the same LUT indexing as scalar_slice_to_rgba().

scalar_slice_to_rgba(→ numpy.ndarray)

Colorize a scalar slice with the same indexing as pyqtgraph makeARGB + extended LUT.

apply_colormap_rgba(→ numpy.ndarray)

Map normalized [0,1] scalar image to RGBA float32 (alpha=1).

populate_vtk_color_transfer_function(→ None)

Fill a vtkColorTransferFunction from registry (presets + custom).

build_vtk_image_lut(name, *[, n, scalar_min, ...])

VTK LUT matching pyqtgraph get_colormap_lut (for surface / volume actors).

build_vtk_lookup_table(name, *[, n, scalar_min, ...])

Build vtkLookupTable for scalar mappers (surface / legacy actors).

Module Contents

brain_deer.presentation.colormap_registry.get_colormap_lut(name: str) → numpy.ndarray | None

Return extended RGBA LUT for pyqtgraph (index 0 = transparent for masked -inf).

brain_deer.presentation.colormap_registry.scalar_values_to_rgba(values: numpy.ndarray, colormap: str, lo: float, hi: float, *, opacity: float = 1.0) → numpy.ndarray

Colorize a 1D scalar array with the same LUT indexing as scalar_slice_to_rgba().

brain_deer.presentation.colormap_registry.scalar_slice_to_rgba(slice_data: numpy.ndarray, colormap: str, lo: float, hi: float, *, opacity: float = 1.0) → numpy.ndarray

Colorize a scalar slice with the same indexing as pyqtgraph makeARGB + extended LUT.

brain_deer.presentation.colormap_registry.apply_colormap_rgba(normalized_data: numpy.ndarray, name: str) → numpy.ndarray

Map normalized [0,1] scalar image to RGBA float32 (alpha=1).

brain_deer.presentation.colormap_registry.populate_vtk_color_transfer_function(ctf, name: str, lo: float, hi: float) → None

Fill a vtkColorTransferFunction from registry (presets + custom).

brain_deer.presentation.colormap_registry.build_vtk_image_lut(name: str, *, n: int = 256, scalar_min: float = 0.0, scalar_max: float = 1.0, below_range_transparent: bool = True)

VTK LUT matching pyqtgraph get_colormap_lut (for surface / volume actors).

brain_deer.presentation.colormap_registry.build_vtk_lookup_table(name: str, *, n: int = 256, scalar_min: float = 0.0, scalar_max: float = 1.0)

Build vtkLookupTable for scalar mappers (surface / legacy actors).