spateo.io.image#

Image IO.

Module Contents#

Functions#

read_image(→ anndata.AnnData)

Load an image into the AnnData object.

spateo.io.image.read_image(adata: anndata.AnnData, filename: str, scale_factor: float, slice: str | None = None, img_layer: str | None = None) anndata.AnnData[source]#

Load an image into the AnnData object.

Parameters:
adata

AnnData object

filename

The path of the image

scale_factor

The scale factor of the image. Define: pixels/DNBs

slice

Name of the slice. Will be used when displaying multiple slices.

img_layer

Name of the image layer.

Returns:

  • uns[‘spatial’][slice][‘images’][img_layer] – The stored image

  • uns[‘spatial’][slice][‘scalefactors’][img_layer] – The scale factor for the spots