thor.analy.read_polygon_ROI

thor.analy.read_polygon_ROI(json_path, adata, img_key=None)[source]

Read polygon ROI from json file.

Parameters:
  • json_path (str) – Path to json file.

  • adata (anndata.AnnData) – Annotated data matrix.

  • img_key (str, optional) – Key for image in adata.uns[‘spatial’] where the ROI was drawn. None for full-resolution image. Valid keys are: ‘hires’, ‘lowres’, ‘fullres’

Returns:

roi_shape – Numpy array of shape (n_vertices, 2) containing the coordinates of the ROI polygon.

Return type:

numpy.ndarray