voyagerpy.utils.get_scale#
- voyagerpy.utils.get_scale(adata: AnnData, res: str | None = None) float#
Get the scale of the image data.
This function returns the scale of the requested image data if it exists. If res is None, the scale of the low resolution is return if it exists, otherwise it returns the scale of the high resolution image if it exists. If res is “hi” or “hires” and the object contains a high resolution image, the scale of the high resolution image data is returned. If res is “lo” or “lowres” and the object contains a low resolution image, the scale of the low resolution image data is returned.
- Parameters:
adata (AnnData) – Annotated data matrix.
res ({None, "hi", "hires", "lo", "lowres"}, optional) – The resolution to get the scale for, by default None
- Returns:
The full-resolution to requested-resolution scale factor.
- Return type:
- Raises:
ValueError – If the requested resolution is not one of None, “hi”, “hires”, “lo”, or “lowres”.
ValueError – If the requested resolution is not found within the image data
KeyError – If the requested resolution is found within the image data, but the scale factor is not found.