squidpy.im.ImageContainer.concat
- classmethod ImageContainer.concat(imgs, library_ids=None, combine_attrs='identical', **kwargs)[source]
Concatenate
imgs
in Z-dimension.All
imgs
need to have the same shape and the same name to be concatenated.- Parameters:
imgs – Images that should be concatenated in Z-dimension.
library_ids – Name for each image that will be associated to each Z-dimension. This should match the
library_id
in the correspondinganndata.AnnData
object. If None, the existing name of the Z-dimension is used for each image.combine_attrs – How to combine attributes of
imgs
. By default, allimgs
need to have the same scale and crop attributes. Usecombine_attrs = 'override'
to relax this requirement. This might lead to a mismatch betweenImageContainer
andanndata.AnnData
coordinates.kwargs – Keyword arguments for
xarray.concat()
.
- Returns:
: Concatenated
squidpy.img.ImageContainer
withimgs
stacks in Z-dimension.- Raises:
ValueError – If any of the
imgs
have more than 1 Z-dimension or iflibrary_ids
are not unique.