lazyslide_models.base.VirtualStainModel

lazyslide_models.base.VirtualStainModel#

class VirtualStainModel#

Bases: DensePredictionModel, ABC

A dense map of one or more synthesised RGB stains.

predict returns [B, C, H, W] with C == 3 * len(stains), ordered RGB-major: channels 3i to 3i + 2 are the RGB planes of stains[i]. Staying 4-D rather than [B, N, 3, H, W] keeps one tensor contract across both dense classes, so a runner needs only one stitching implementation and splits the result afterwards.

Attributes:
stainstuple of str

The stains synthesised, e.g. ("PAS",) or ("HER2 IHC",). There is no default: a virtual stain that does not say which stain it produces carries no usable metadata, since its channels are only R, G, B.