Skip to content

API reference

This package contains a number of classes representing OME-Zarr groups. Each of these classes represent a single OME-Zarr group.

Each group has a set of associated metadata attributes, which provide a listing of the OME-Zarr attributes available for each group. To access these, use the .ome_attributes property on the group objects.

A listing of the group objects and associated metadata objects is given below for each version of the OME-Zarr specification.

OME-Zarr 0.5

OME-Zarr group objects Metadata attributes Creation helper
HCS HCSAttrs
Image ImageAttrs Image.new()
Labels LabelsAttrs
ImageLabel ImageLabelAttrs
Well WellAttrs
BioFormats2Raw BioFormats2RawAttrs

OME-Zarr 0.4

OME-Zarr group objects Metadata attributes Creation helper
HCS HCSAttrs
Image ImageAttrs Image.new()
Labels LabelsAttrs
ImageLabel ImageLabelAttrs
Well WellAttrs
BioFormats2Raw BioFormats2RawAttrs

Helper functions

ome_zarr_models.open_ome_zarr

open_ome_zarr(group: Group | StoreLike, *, version: Literal['0.4', '0.5'] | None = None) -> BaseGroup

Create an ome-zarr-models object from an existing OME-Zarr group.

This function will 'guess' which type of OME-Zarr data exists by trying to validate each group metadata definition against your data. If validation is successful, that data class is returned without trying any more.

It tries more recent versions of OME-Zarr first.

Parameters:

Name Type Description Default
group (Group, StoreLike)

Zarr group containing OME-Zarr data. Alternatively any object that can be parsed by zarr.open_group.

required
version Literal['0.4', '0.5']

If you know which version of OME-Zarr your data is, you can specify it here. If not specified, all versions will be tried. The default is None, which means all versions will be tried.

None

Raises:

Type Description
RuntimeError

If the passed group cannot be validated with any of the OME-Zarr group models.

Warnings

This will try and load your data with every version of every OME-Zarr group type, until a match is found. If data access is slow (e.g., in a remote store), this may take a long time. It will be quicker to directly use the OME-Zarr group class if you know which version and group you expect.

Development version

This is the latest in-progress development version of the OME-Zarr specification. Warning: only to be used for experimentation and evaluating the work-in-progress specification. The development version of OME-Zarr and implementation in ome-zarr-models may change without notice.

OME-Zarr group objects Metadata attributes Creation helper
HCS HCSAttrs
Image ImageAttrs Image.new()
Labels LabelsAttrs
ImageLabel ImageLabelAttrs
Well WellAttrs
BioFormats2Raw BioFormats2RawAttrs