lazyslide.seg.tissue

Contents

lazyslide.seg.tissue#

tissue(wsi, *, model='pathprofiler', level=None, mpp=None, bbox_ratio=0.05, min_area=0.001, min_hole_area=1e-05, detect_holes=True, threshold=0.5, device=None, amp=None, autocast_dtype=None, key_added='tissues')#

Perform tissue segmentation powered by a deep learning model.

Supported models:

If you encounter a memory issue, please set a higher mpp value.

Parameters:
wsiwsidata.WSIData

The whole slide image.

model{“grandqc”, “pathprofiler”, “hest”}, default: “pathprofiler”

The model to use for tissue segmentation.

levelint, default: None

The level to segment the tissue, mutually exclusive with mpp.

mppfloat, default: None

The mpp level to segment the tissue, mutually exclusive with level.

bbox_ratiofloat, default: 0.05

The ratio of the bounding box to filter the false positive tissue polygons.

min_areafloat, default: 1e-3

The minimum area of the tissue polygon.

min_hole_areafloat, default: 1e-5

The minimum area of the hole in the tissue polygon.

detect_holesbool, default: True

Whether to detect holes in the tissue polygons.

thresholdfloat, default: 0.5

The probability threshold to consider a pixel as tissue.

devicestr, default: None

The device to run the model.

ampbool, optional, default: False

Whether to use automatic mixed precision.

autocast_dtypetorch.dtype, optional, default: torch.float16

The dtype for automatic mixed precision.

key_addedstr, default: ‘tissues’

The key to add the tissue polygons.