voyagerpy.spatial.detect_tissue_threshold#

voyagerpy.spatial.detect_tissue_threshold(adata: AnnData, size: str = 'hires', low: int = 200, high: int = 255) Tuple[int, Any | None]#

Detect the tissue boundary using a thresholding method. The contours are evaluated from the image in adata.uns["spatial"]["img"][size]

Parameters:
  • adata (AnnData) – Annotated data matrix.

  • size ({"hires", "lowres"}, optional) – The resolution of the image to use for tissue detction, by default “hires”

  • low (int, optional) – The minimum threshold values, by default 200

  • high (int, optional) – The maximum threshold value, by default 255

Returns:

The threshold value and the contour of the tissue boundary.

Return type:

Tuple[int, Optional[Contour]]