wsidata.accessors.iter.TissueImage#

class TissueImage(tissue_id, shape, image, downsample=1.0, format='yxc', mask_bg=None)#

Bases: TissueContour

The data container return by wsidata.iter.tissue_images

This container shares the same attributes as TissueContour.

Attributes:
imagenp.ndarray

The tissue image.

downsamplefloat

The downsample factor of the image relative to level 0.

masknp.ndarray

The tissue mask.

masked_imagenp.ndarray

The masked image with the background masked.

property masked_image#

A masked image with the background masked will be returned if the mask_bg is not None.

plot(ax=None, masked=None, **kwargs)#

Plot the tissue image.

Parameters:
axAxes

The axes to plot the image.

maskedbool

Whether to show the masked image.

**kwargs

Additional keyword arguments for imshow.