estimate_white_point#
- squidpy.experimental.im.estimate_white_point(sdata, *, image_key, tissue_mask_key=None, scale='auto')[source]#
Estimate the white point
I_0from a slide’s background (non-tissue median).Opt-in alternative to the fixed dtype-aware default white point, for a slide whose unstained background is genuinely not full white. Samples the per-channel median over non-tissue pixels (background = the complement of the
detect_tissue()mask).- Parameters:
- sdata
SpatialData The SpatialData object and the RGB image key.
- image_key
str The SpatialData object and the RGB image key.
- tissue_mask_key
str|None(default:None) Tissue-label element key (defaults to
f"{image_key}_tissue"); a tissue mask is required, as forfit_stain_reference().- scale
str|Literal['auto'] (default:'auto') Scale level to sample on.
"auto"uses the coarsest level. The sampled level is materialised to take the median, so keep this coarse - do not pass a fine level on a whole-slide image.
- sdata
- Returns:
ndarray– Shape-(3,)white point; pass it aswhite_pointtofit_stain_reference()/decompose().