voyagerpy.spatial.get_spot_coords#
- voyagerpy.spatial.get_spot_coords(adata: AnnData, subset: None | Series | slice = None, as_tuple: bool = True, as_df: bool = False, res: str | None = None) ndarray | Tuple[ndarray, ndarray] | DataFrame#
Get the spot coordinates in the image.
- Parameters:
adata (AnnData) – Annontated data matrix.
subset (Union[None, pd.Series, slice], optional) – Subset of observations to get the spot coordinates from, by default None.
as_tuple (bool, optional) – If True, return the coordinates as a tuple of arrays (x, y), by default True
as_df (bool, optional) – If True, return the the coordinates as a dataframe, by default False.
res (Optional[str], optional) – The resolution to scale the coordinates for. If None, this is determined automatically , by default None.
- Returns:
The coordinates of the selected spots, as a tuple, dataframe, or Nx2 array.
- Return type:
Union[np.ndarray, Tuple[np.ndarray, np.ndarray], pd.DataFrame]