Skip to main content
Abstract interface for tissue mask providers. Defines the TissueMaskProvider abstract base class that TileExtractor depends on for obtaining binary tissue masks.

TissueMaskProvider

Abstract base class for tissue mask providers. Every provider must implement generate, which receives an open WSIReader and returns a 2-D uint8 binary mask where 1 = tissue. TileExtractor depends only on this interface, so any concrete provider — algorithmic, model-based, or pre-computed — can be plugged in. Example:

generate

Generates a binary tissue mask for the given slide.
An open WSI reader.
Whether to display a progress bar. Defaults to True.
Returns:
  • np.ndarray - A uint8 mask of shape (H, W) with values in {0, 1} where 1 = tissue.