stlearn.add.image(adata: AnnData, imgpath: Union[Path, str], library_id: str, quality: str = 'hires', scale: float = 1.0, visium: bool = False, spot_diameter_fullres: float = 50, copy: bool = False) Optional[AnnData][source]

Adding image data to the Anndata object

  • adata – Annotated data matrix.

  • imgpath – Image path.

  • library_id – Identifier for the visium library. Can be modified when concatenating multiple adata objects.

  • scale – Set scale factor.

  • quality – Set quality that convert to stlearn to use. Store in anndata.obs[‘imagecol’ & ‘imagerow’].

  • visium – Is this anndata read from Visium platform or not.

  • copy – Return a copy instead of writing to adata.


  • Depending on copy, returns or updates adata with the following fields.

  • **tissue_img** (adata.uns field) – Array format of image, saving by Pillow package.