TiledTissueMask, which walks a WSI in fixed-size patches, processes them through a TissueMaskModel, and stitches the per-tile predictions into a full-slide binary mask.
TiledTissueMask
TissueMaskModel with a tiling strategy to produce a full-slide binary mask. The workflow is:
- Compute the tissue bounding box at resolution.
- Walk the bounding box in non-overlapping tile_size patches.
- Collect patches into batches of batch_size.
- Pass each batch to
model.process()— this is where GPU parallelism happens for DL models. - Stitch the per-tile masks back into the output array.
The processing model.
(width, height) of each patch. When None, derived from model.tile_spec.Resolution at which to read tiles. When
None, derived from model.tile_spec.Number of tiles per model call. Set higher for GPU models (e.g. 32–64). Defaults to
1.generate
An open WSI reader.
Whether to display a per-tile progress bar. Defaults to
True.Maximum concurrent HTTP requests. Defaults to 64.
A
uint8 mask of shape (H, W) covering the tissue bounding box at resolution, with values in {0, 1} where 1 = tissue.
