phenotypic.sdk_.napari_.add_image_layer#
- phenotypic.sdk_.napari_.add_image_layer(viewer, array, *, name: str, visible: bool = True, gamma: float = 1.0)[source]#
Add (or replace) an image layer with non-stretched contrast limits.
Mirrors the contrast convention of the detect-mode preview tool (
DetectMat.preview_modes): integer layers use the full dtype range and single-channel normalized float intensities use a fixed(0.0, 1.0)range. This renders each layer at its true brightness instead of letting napari auto-stretch the display to the data’s own(min, max)— which exaggerates contrast and makes layers look washed out when several are shown together. Three-dimensional arrays are treated as RGB.- Parameters:
viewer – A napari
Viewer(or any object exposinglayersandadd_image).array – The image array — 2-D intensity or 3-D RGB.
name (str) – Layer name. An existing layer with this name is updated in place rather than duplicated.
visible (bool) – Initial layer visibility. Defaults to True.
gamma (float) – Display gamma. Defaults to 1.0 (no gamma adjustment).
- Returns:
The created or updated napari image layer.