spatialdata_io.image

Contents

spatialdata_io.image#

spatialdata_io.image(input, data_axes, coordinate_system, use_tiff_memmap=True, chunks=None, scale_factors=None)#

Read an image file and returns a parsed Image2D spatial element.

Parameters:
  • input (Path) – Path to the image file.

  • data_axes (Sequence[str]) – Axes of the data (e.g., (‘c’, ‘y’, ‘x’) or (‘y’, ‘x’, ‘c’)).

  • coordinate_system (str) – Coordinate system of the spatial element.

  • use_tiff_memmap (bool (default: True)) – Whether to use memory-mapped reading for TIFF files.

  • chunks (int | tuple[int, ...] | tuple[tuple[int, ...], ...] | Mapping[Any, None | int | tuple[int, ...]] | None (default: None)) – Chunk size specification. Can be: - int: Applied to all dimensions - tuple: Chunk sizes matching the order of output axes (c, y, x) - dict: Mapping of axis names to chunk sizes (e.g., {‘c’: 1, ‘y’: 1000, ‘x’: 1000}) If None, uses a default (DEFAULT_CHUNK_SIZE) for all axes.

  • scale_factors (Sequence[int] | None (default: None)) – Scale factors for building a multiscale image pyramid. Passed to Image2DModel.parse().

Return type:

DataArray

Returns:

: Parsed Image2D spatial element.