Skip to content

Feature request: H&E color normalization in napari viewer #426

Description

@jwrth

When viewing H&E images in napari, colors often appear washed out or inconsistent across slides due to staining variation and scanner-specific color responses. Tools like Aperio ImageScope and QuPath address this with built-in color normalization (white balance correction, ICC profile application, Reinhard normalization).

It would be useful to have a similar option in the InSituPy napari viewer - either as a toggle widget or applied automatically on image load. The normalization could include:

  • White balance correction using background pixels or the slide's embedded ICC profile (available in SVS files via tifffile/openslide)
  • Reinhard color normalization to a user-defined or built-in reference slide
  • Optional Macenko/Vahadane stain deconvolution for more robust correction

This would improve visual consistency when comparing multiple slides and make the viewer more suitable for pathologist-facing workflows.

Possible implementation: A small preprocessing step on the RGB array before passing it to the napari layer, wrapped in an optional widget. Libraries like staintools, torchstain, or histomicstk could serve as backends.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions