hest.segmentation.cell_segmenters.segment_cellvit

hest.segmentation.cell_segmenters.segment_cellvit(wsi_path: str, name: str, src_pixel_size: float = None, dst_pixel_size: float = 0.5, batch_size=2, gpu_ids=[0], save_dir='results/segmentation', model: str = 'CellViT-SAM-H-x20.pth') str

Segment nuclei with CellViT

Parameters:
  • wsi_path (str) – path to slide to segment (.tiff prefered)

  • name (str) – name of run

  • src_pixel_size (float, optional) – pixel size (um/px) of the slide at wsi_path. Defaults to None.

  • dst_pixel_size (float, optional) – patch will be resized to this (um/px) before being fed to CellViT. Defaults to 0.25.

  • batch_size (int, optional) – batch_size. Defaults to 2.

  • gpu_ids (List[int], optional) – list of gpu ids to use during inference. Defaults to [0].

  • save_dir (str, optional) – directory where to save the output. Defaults to ‘results/segmentation’.

  • model (str, optional) –

    name of model weights to use. Defaults to ‘CellViT-SAM-H-x20.pth’. List of weights available:

    • ’CellViT-256-x20.pth’

    • ’CellViT-256-x40.pth’

    • ’CellViT-SAM-H-x40.pth’

    • ’CellViT-SAM-H-x20.pth’

Returns:

path to the result segmentation .geojson

Return type:

str