spatialdata_io.xenium_aligned_image#
- spatialdata_io.xenium_aligned_image(image_path, alignment_file, imread_kwargs=mappingproxy({}), image_models_kwargs=mappingproxy({}), dims=None, rgba=False, c_coords=None)#
Read an image aligned to a Xenium dataset, with an optional alignment file.
- Parameters:
alignment_file (
str|Path|None) – Path to the alignment file, if not passed it is assumed that the image is aligned.image_models_kwargs (
Mapping[str,Any] (default:mappingproxy({}))) – Keyword arguments to pass to the image models.dims (
tuple[str,...] |None(default:None)) – Dimensions of the image (tuple of axes names); valid strings are “c”, “x” and “y”. If not passed, the function will try to infer the dimensions from the image shape. Please use this argument when the default behavior fails. Example: for an image with shape (1, y, 1, x, 3), use dims=(“anystring”, “y”, “dummy”, “x”, “c”). Values that are not “c”, “x” or “y” are considered dummy dimensions and will be squeezed (the data must have len 1 for those axes).rgba (
bool(default:False)) – Interprets thecchannel as RGBA, by setting the channel names tor,g,b(a). Whenc_coordsis notNone, this argument is ignored.c_coords (
list[str] |None(default:None)) – Channel names for the image. By default, the function will try to infer the channel names from the image shape and name (by detecting if the name suggests that the image is a H&E image). Example: for an RGB image with shape (3, y, x), use c_coords=[“r”, “g”, “b”].
- Return type:
- Returns:
: The single-scale or multi-scale aligned image element.