lazyslide.seg.artifact

Contents

lazyslide.seg.artifact#

artifact(wsi, tile_key, variants='grandqc_7x', tissue_key='tissues', batch_size=4, num_workers=0, device=None, key_added='artifacts')#

Artifact segmentation for the whole slide image.

Run GrandQC [Weng et al., 2024] artifact segmentation model on the whole slide image. The model is trained on 512x512 tiles with mpp=1.5, 2, or 1.

It can detect the following artifacts:

  • Fold

  • Darkspot & Foreign Object

  • Pen Marking

  • Edge & Air Bubble

  • Out of Focus

Parameters:
wsiWSIData

The WSIData object to work on.

tile_keystr

The key of the tile table.

variants{“grandqc_5x”, “grandqc_7x”, “grandqc_10x”}, default: “grandqc_7x”

The model variant to use for segmentation.

tissue_keystr, default: Key.tissue

The key of the tissue table.

batch_sizeint, default: 4

The batch size for segmentation.

num_workersint, default: 0

The number of workers for data loading.

devicestr, default: None

The device for the model.

key_addedstr, default: “artifacts”

The key for the added artifact shapes.