squidpy.im.ImageContainer.subset

ImageContainer.subset(adata, spatial_key='spatial', copy=False)[source]

Subset anndata.AnnData using this container.

Useful when this container is a crop of the original image.

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

  • spatial_key (str) – Key in anndata.AnnData.obsm where spatial coordinates are stored.

  • copy (bool) – Whether to return a copy of adata.

Return type:

AnnData

Returns:

: Subset of anndata.AnnData.