Skip to content

Allow colormap scaling to reflect raw counts instead of hard-coded [0, 1] range #387

@lijinbio

Description

@lijinbio

Hi there,

Currently, when visualizing gene expression or numerical observations in napari-spatialdata, the colormap and colorbar appear to be hard-coded to a range of $[0, 1]$. This is specifically seen in src/napari_spatialdata/_widgets.py (around line 488), where the data is normalized before being passed to the visualization layer.While normalization is useful for consistent styling, it makes it impossible for users to see the actual raw counts of a gene on the colorbar or via the contrast limits slider. For example, if a gene's expression ranges from 0 to 50, the colorbar still displays 0 to 1, and the user has no visual confirmation of the true expression magnitude.

I would like an option (or a change in default behavior) where:

  1. The colormap scale and contrast limits are automatically set to (min, max) of the raw counts for the selected gene/variable.
  2. The colorbar widget reflects these true values instead of the normalized $[0, 1]$ range.
  3. Users can manually adjust these limits in the napari layer controls to values outside the $[0, 1]$ range if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions