Skip to content

OME-Zarr groups

ome_zarr_models._v06.BioFormats2Raw

Bases: BaseGroupv06[BioFormats2RawAttrs]

An OME-Zarr bioformats2raw dataset.

Warnings

It is not recommended to write new bioformats2raw groups. bioformats2raw is designed to support existing legacy data, and will be superseded by other OME-Zarr features in the future.

Notes

Currently this class does not offer a way to access OME-XML metadata. Please comment on issue #374 if you would find accessing OME-XML metadata useful.

Attributes:

Name Type Description
zarr_format Literal[3]
node_type Literal['group']
attributes BaseZarrAttrs[BioFormats2RawAttrs]
members Mapping[str, GroupSpec | ArraySpec] | None

image_paths

image_paths: list[str]

All paths to OME-Zarr images in this group.

images

images: dict[str, Image]

All images in this group.

Returns:

Type Description
images

Mapping from image path to Image object.

from_zarr

from_zarr(group: Group) -> Self

Create an OME-Zarr BioFormats2Raw model from a zarr.Group.

Parameters:

Name Type Description Default
group Group

A Zarr group that has valid OME-Zarr bioformats2raw metadata.

required

ome_zarr_models._v06.HCS

Bases: BaseGroupv06[HCSAttrs]

An OME-Zarr high content screening (HCS) dataset.

Attributes:

Name Type Description
zarr_format Literal[3]
node_type Literal['group']
attributes BaseZarrAttrs[HCSAttrs]
members Mapping[str, GroupSpec | ArraySpec] | None

n_wells

n_wells: int

Number of wells.

well_groups

well_groups: Generator[Well, None, None]

Well groups within this HCS group.

Notes

Only well groups that exist are returned. This can be less than the number of wells defined in the HCS metadata if some of the well Zarr groups don't exist.

from_zarr

from_zarr(group: Group) -> Self

Create an OME-Zarr image model from a zarr.Group.

Parameters:

Name Type Description Default
group Group

A Zarr group that has valid OME-Zarr image metadata.

required

get_well_group

get_well_group(i: int) -> Well

Get a single well group.

Parameters:

Name Type Description Default
i int

Index of well group.

required

Raises:

Type Description
WellGroupNotFoundError

If no Zarr group is found at the well path.

ome_zarr_models._v06.Image

Bases: BaseGroupv06[ImageAttrs]

An OME-Zarr image dataset.

Attributes:

Name Type Description
zarr_format Literal[3]
node_type Literal['group']
attributes BaseZarrAttrs[ImageAttrs]
members Mapping[str, GroupSpec | ArraySpec] | None

datasets

datasets: tuple[tuple[Dataset, ...], ...]

Get datasets stored in this image.

The first index is for the multiscales. The second index is for the dataset inside that multiscales.

labels

labels: Labels | None

Any labels datasets contained in this image group.

Returns None if no labels are present.

from_zarr

from_zarr(group: Group) -> Self

Create an OME-Zarr image model from a zarr.Group.

Parameters:

Name Type Description Default
group Group

A Zarr group that has valid OME-Zarr image metadata.

required

new

new(*, array_specs: Sequence[AnyArraySpec], paths: Sequence[str], axes: Sequence[Axis], scales: Sequence[Sequence[float]], translations: Sequence[Sequence[float] | None], name: str | None = None, multiscale_type: str | None = None, metadata: JsonValue | None = None, global_scale: Sequence[float] | None = None, global_translation: Sequence[float] | None = None) -> Image

Create a new Image from a sequence of multiscale arrays and spatial metadata.

Parameters:

Name Type Description Default
array_specs Sequence[AnyArraySpec]

A sequence of array specifications that collectively represent the same image at multiple levels of detail.

required
paths Sequence[str]

The paths to the arrays within the new Zarr group.

required
axes Sequence[Axis]

Axis objects describing the axes of the arrays.

required
scales Sequence[Sequence[float]]

For each array, a scale value for each axis of the array.

required
translations Sequence[Sequence[float] | None]

For each array, a translation value for each axis the array.

required
name str | None

A name for the multiscale collection.

None
multiscale_type str | None

Type of downscaling method used to generate the multiscale image pyramid. Optional.

None
metadata JsonValue | None

Arbitrary metadata to store in the multiscales group.

None
global_scale Sequence[float] | None

A global scale value for each axis of every array.

None
global_translation Sequence[float] | None

A global translation value for each axis of every array.

None
Notes

This class does not store or copy any array data. To save array data, first write this class to a Zarr store, and then write data to the Zarr arrays in that store.

ome_zarr_models._v06.ImageLabel

Bases: BaseGroupv06[ImageLabelAttrs]

An OME-Zarr image label dataset.

Attributes:

Name Type Description
zarr_format Literal[3]
node_type Literal['group']
attributes BaseZarrAttrs[ImageLabelAttrs]
members Mapping[str, GroupSpec | ArraySpec] | None

from_zarr

from_zarr(group: Group) -> Self

Create an instance of an OME-Zarr image from a zarr.Group.

Parameters:

Name Type Description Default
group Group

A Zarr group that has valid OME-Zarr image label metadata.

required

ome_zarr_models._v06.Labels

Bases: BaseGroupv06[LabelsAttrs]

An OME-Zarr labels dataset.

Attributes:

Name Type Description
zarr_format Literal[3]
node_type Literal['group']
attributes BaseZarrAttrs[LabelsAttrs]
members Mapping[str, GroupSpec | ArraySpec] | None

label_paths

label_paths: list[str]

List of paths to image-label groups within this labels group.

from_zarr

from_zarr(group: Group) -> Self

Create an OME-Zarr labels model from a zarr.Group.

Parameters:

Name Type Description Default
group Group

A Zarr group that has valid OME-Zarr label metadata.

required

get_image_labels_group

get_image_labels_group(path: str) -> ImageLabel

Get a image labels group at a given path.

ome_zarr_models._v06.Well

Bases: BaseGroupv06[WellAttrs]

An OME-Zarr well dataset.

Attributes:

Name Type Description
zarr_format Literal[3]
node_type Literal['group']
attributes BaseZarrAttrs[WellAttrs]
members Mapping[str, GroupSpec | ArraySpec] | None

from_zarr

from_zarr(group: Group) -> Self

Create an OME-Zarr well model from a zarr.Group.

Parameters:

Name Type Description Default
group Group

A Zarr group that has valid OME-Zarr well metadata.

required