ngff_zarr.to_ngff_imageΒΆ
Module ContentsΒΆ
FunctionsΒΆ
Extract the full-resolution array from a zarr Group. |
|
Create an image with pixel array and metadata to following the OME-NGFF data model. |
APIΒΆ
- ngff_zarr.to_ngff_image._extract_array_from_group(group: zarr.core.group.Group)ΒΆ
Extract the full-resolution array from a zarr Group.
For multi-level TIFFs (e.g., pyramidal OME-TIFF), tifffile returns a zarr Group containing multiple arrays (one per resolution level). This function extracts the full-resolution array, using multiscales metadata if available.
- ngff_zarr.to_ngff_image.to_ngff_image(
- data: numpy.typing.ArrayLike | collections.abc.MutableMapping | str | zarr.core.array.Array | zarr.core.group.Group,
- dims: collections.abc.Sequence[ngff_zarr.v04.zarr_metadata.SupportedDims] | None = None,
- scale: collections.abc.Mapping[collections.abc.Hashable, float] | None = None,
- translation: collections.abc.Mapping[collections.abc.Hashable, float] | None = None,
- name: str = 'image',
- axes_units: collections.abc.Mapping[str, ngff_zarr.v04.zarr_metadata.Units] | None = None,
- channel_names: collections.abc.Sequence[str] | None = None,
Create an image with pixel array and metadata to following the OME-NGFF data model.
- Parameters:
data (ArrayLike, ZarrArray, ZarrGroup, MutableMapping, str) β Multi-dimensional array that provides the image pixel values. It can be a numpy.ndarray or another type that behaves like a numpy.ndarray, i.e. an ArrayLike. If a ZarrArray, MutableMapping, or str, it will be loaded into Dask lazily as a zarr Array. If a ZarrGroup, the first array in the group will be used.
dims (sequence of hashable, optional) β Tuple specifying the data dimensions. Values should drawn from: {βtβ, βzβ, βyβ, βxβ, βcβ} for time, third spatial direction, second spatial direction, first spatial dimension, and channel or component, respectively spatial dimension, and time, respectively.
scale (dict of floats, optional) β Pixel spacing for the spatial dims
translation (dict of floats, optional) β Origin or offset of the center of the first pixel.
name (str, optional) β Name of the resulting image
axes_units (dict of str, optional) β Units to associate with the axes. Should be drawn from UDUNITS-2, enumerated at https://ngff.openmicroscopy.org/latest/#axes-md
channel_names (sequence of str, optional) β Optional list of channel names. Length should match the number of channels in the data (size of βcβ dimension).
- Returns:
Representation of an image (pixel data + metadata) for a single scale of an NGFF-OME-Zarr multiscale dataset
- Return type: