thor.pp.nuclei_segmentation

thor.pp.nuclei_segmentation(image_path, save_dir=None, tile_size=(1000, 1000), method='stardist', **segment_kwds)[source]

Segment nuclei from H&E stained images using stardist, cellpose or histocartography. The segmentation mask is saved as a sparse matrix in .npz format.

Parameters:
  • image_path (str) – Path to the full resolution image to segment.

  • save_dir (str, optional) – Path to the directory where to save the segmentation mask.

  • tile_size (tuple, optional) – Size of the tiles to use for stardist segmentation.

  • method (str) – Segmentation method to use. Can be ‘stardist’, ‘cellpose’ or ‘histocartography’.

  • segment_kwds (dict) – Keyword arguments to pass to the segmentation function.