lazyslide.seg.artifact#
- artifact(wsi, tile_key, model='grandqc', variant='7x', batch_size=4, num_workers=0, device=None, key_added='artifacts', *args)#
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:
- wsi
WSIData The WSIData object to work on.
- tile_keystr
The key of the tile table.
- model{“grandqc”}, default: “grandqc”
The model to use for artifact segmentation.
- variantstr, default: “7x”
The model variants, grandqc has variants 5x, 7x and 10x.
- 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.
- wsi