lazyslide_models.tile_prediction.cv_features.ColorDeconvolutionMap

lazyslide_models.tile_prediction.cv_features.ColorDeconvolutionMap#

class ColorDeconvolutionMap(stain='hed')#

Bases: MarkerMapModel

color_deconvolution_map Paper [Ruifrok and Johnston, 2001] Per-pixel amount of each stain, by color deconvolution

Map the stains of a tile by color deconvolution, one value per pixel.

The per-pixel amounts that ColorDeconvolution averages over a tile, in the same units. Run it with virtual_stain to store the stains as one image, a channel each, as float32 at the tile resolution: use a coarse tile set for a whole-slide map. Parts of the slide no tile covers stay zero.

>>> zs.tl.virtual_stain(wsi, "color_deconvolution_map", image_key="stains")
>>> wsi.images["stains"]
Parameters:
stainstr or dict, default: “hed”

The stains to unmix, as for ColorDeconvolution.

predict(image)#

Predict from a [B, C, H, W] tile batch.

Returns a float tensor of shape [B, C, H, W], already activated and within output_range when that is declared.