squidpy.experimental.im.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) – Tissue-label element key (defaults tof"{image_key}_tissue"); a tissue mask is required, as forfit_stain_reference().scale (
Union[str,Literal['auto']]) – Scale level to sample on."auto"(default) 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.
- Return type:
- Returns:
Shape-
(3,)white point; pass it aswhite_pointtofit_stain_reference()/decompose_stains().