OME-Zarr metadata — NGFF 0.5
Changes from NGFF 0.4
- The per-object
versionfield is dropped from every payload carrier — Multiscale, ImageLabel, Omero, Plate and Well. The version is now recorded once, on the top-level OME container, where it discriminates the metadata version. - At the storage layer, 0.5 nests all OME metadata under a single
"ome"key in a group's attributes; 0.4 and earlier wrote the same fields at the top level ofattrs.
abczarr.ome.v0_5.ome
abczarr.ome.v0_5.ome
The top-level metadata attached to an OME-Zarr group.
OME and its subclasses each describe what kind of group carries them, an image, a plate, a well, a collection of labels, and so on.
Classes
OME
OME(*, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}), version: Literal['0.5'] = '0.5')
Bases: OME
OME-Zarr metadata attached to a Zarr group.
An image, a plate, a well, and a set of labels are each represented by a different subclass that adds the fields for what it holds. See OMEImage, OMEPlate, and OMEWell for examples.
Attributes
version
class-attribute
instance-attribute
version: Required[Version] = field(kw_only=True)
The OME-NGFF version the metadata is written against.
Methods:
OMESeries
OMESeries(series: Iterable[str | bytes] | None = None, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}), version: Literal['0.5'] = '0.5')
OMEImage
OMEImage(multiscales: Iterable[Multiscale | JsonDict | list[Axis]], omero: Omero | JsonDict | list[Channel] = MISSING, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}), version: Literal['0.5'] = '0.5')
Bases: OME
Metadata for an image group.
The group holds one or more multiscale pyramids and, optionally, settings for how the image should be rendered.
Attributes
multiscales
instance-attribute
multiscales: Required[list[Multiscale]]
The group's resolution pyramids, each a Multiscale object. An image almost always has exactly one.
omero
instance-attribute
omero: Optional[Omero]
Rendering settings suggesting how a viewer should display the image's channels. See Omero for the fields it carries. Optional.
Methods:
OMEImageLabel
OMEImageLabel(multiscales: Iterable[Multiscale | JsonDict | list[Axis]], omero: Omero | JsonDict | list[Channel] = MISSING, image_label: ImageLabel | JsonDict | list[Color], *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}), version: Literal['0.5'] = '0.5')
Bases: OMEImage
Metadata for a label image.
A label image is an OMEImage whose pixel values name segments.
Attributes
image_label
class-attribute
instance-attribute
image_label: Required[ImageLabel] = field(json='image-label')
The ImageLabel metadata describing those segments, including their display colors and any per-label properties.
Methods:
OMELabels
OMELabels(labels: Iterable[str | bytes], *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}), version: Literal['0.5'] = '0.5')
Bases: OME
Metadata for a group that collects a set of label images.
Attributes
labels
instance-attribute
labels: Required[list[str]]
The path of each subgroup that holds a label image. Each such subgroup is in turn represented by an OMEImageLabel object.
Methods:
OMEPlate
OMEPlate(plate: Plate | JsonDict | list[Acquisition], *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}), version: Literal['0.5'] = '0.5')
OMEWell
OMEWell(well: Well | JsonDict | list[Image], *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}), version: Literal['0.5'] = '0.5')
Bases: OME
Metadata for a well group.
A well group holds the images captured at one position of a plate.
OMEBioformats2Raw
OMEBioformats2Raw(bioformats2raw_layout: Literal[3] = 3, plate: Plate | JsonDict | list[Acquisition], *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}), version: Literal['0.5'] = '0.5')
Bases: OME
Metadata for the root group of a bioformats2raw-converted dataset.
Attributes
bioformats2raw_layout
class-attribute
instance-attribute
bioformats2raw_layout: Required[Literal[3]] = field(json='bioformats2raw.layout')
Marks the group as following the bioformats2raw layout. Its
value is always 3.
plate
instance-attribute
plate: Required[Plate]
The Plate metadata, present when the converted dataset describes a screening plate. This field is optional in OME-NGFF 0.1, and required from 0.2 on.
Methods:
abczarr.ome.v0_5.images
abczarr.ome.v0_5.images
The multiscale image pyramid.
Multiscale describes a pyramid of progressively downsampled resolution levels. Each level is a Dataset, naming a Zarr array and how it is positioned relative to the others.
Classes
Dataset
Dataset(path: str | bytes, coordinateTransformations: tuple[Scale | JsonDict | Literal['scale']] | tuple[Scale | JsonDict | Literal['scale'], Translation | JsonDict | Literal['translation']], *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
One resolution level of a multiscale pyramid.
Attributes
path
class-attribute
instance-attribute
path: Required[str] = field(factory=False)
The name of the Zarr array holding this level, relative to the image group.
coordinateTransformations
instance-attribute
coordinateTransformations: Required[tuple[Scale] | tuple[Scale, Translation]]
Places this level in the pyramid's physical space: a Scale, optionally followed by a Translation, one value per axis.
Methods:
Multiscale
Multiscale(axes: Iterable[Axis | JsonDict | str], datasets: Iterable[Dataset | JsonDict | str], coordinateTransformations: Iterable[CoordinateTransformation | JsonDict | str] = MISSING, name: str | bytes = MISSING, type: str | bytes = MISSING, metadata: Metadata | JsonDict | str = MISSING, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
A multiscale image pyramid: its axes and resolution levels.
Attributes
axes
instance-attribute
axes: Required[list[Axis]]
The pyramid's dimensions, in the order every array shape and every coordinate transformation the pyramid carries uses. Each entry is an Axis.
datasets
instance-attribute
datasets: Required[list[Dataset]]
The pyramid's resolution levels, from full resolution down. Each entry is a Dataset.
coordinateTransformations
instance-attribute
coordinateTransformations: Optional[list[CoordinateTransformation]]
Transformations applied to every level, after that level's own transformations have run. A level's own transformations map that level into the coordinate space the pyramid shares. These transformations then apply within that shared space. Optional.
type
instance-attribute
type: Recommended[str]
The method used to generate the lower resolutions, such as
"gaussian". Recommended.
metadata
instance-attribute
metadata: Recommended[Metadata]
Further, free-form detail about how the lower resolutions were generated. Recommended.
Classes
Metadata
Metadata(method: str | bytes = MISSING, version: str | bytes = MISSING, args: Any = MISSING, kwargs: Iterable[tuple[str | bytes, Any]] | Mapping[str | bytes, Any] = MISSING, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
Free-form detail about how a pyramid's lower resolutions were generated.
instance-attribute
version: Optional[str]
The version of the software that ran method. Optional.
instance-attribute
args: Optional[Json]
The positional arguments method was called with. The
upstream corpus writes this as a bare string as well as a list,
so it is read as any JSON value rather than coerced into a
list. Optional.
instance-attribute
The keyword arguments method was called with. Optional.
Methods:
abczarr.ome.v0_5.axes
abczarr.ome.v0_5.axes
An axis of a multiscale pyramid: its name, type, and unit.
Attributes
SpaceUnit
module-attribute
SpaceUnit = tx.Literal['angstrom', 'attometer', 'centimeter', 'decimeter', 'exameter', 'femtometer', 'foot', 'gigameter', 'hectometer', 'inch', 'kilometer', 'megameter', 'meter', 'micrometer', 'mile', 'millimeter', 'nanometer', 'parsec', 'petameter', 'picometer', 'terameter', 'yard', 'yoctometer', 'yottameter', 'zeptometer', 'zettameter']
TimeUnit
module-attribute
TimeUnit = tx.Literal['attosecond', 'centisecond', 'day', 'decisecond', 'exasecond', 'femtosecond', 'gigasecond', 'hectosecond', 'hour', 'kilosecond', 'megasecond', 'microsecond', 'millisecond', 'minute', 'nanosecond', 'petasecond', 'picosecond', 'second', 'terasecond', 'yoctosecond', 'yottasecond', 'zeptosecond', 'zettasecond']
Classes
Axis
Axis(name: str | bytes, type: str | bytes = MISSING, unit: str | bytes = MISSING, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
One dimension of a Multiscale pyramid.
An axis's position in a
Multiscale's axes list is its
position in every array shape and every coordinate transformation the
pyramid carries. Constructing an Axis with type="space" returns a
SpaceAxis, and likewise for
"time" and "channel", each restricting unit to the units that
type allows.
Attributes
name
class-attribute
instance-attribute
name: Required[str] = field(factory=False)
The axis's label, such as "x" or "channel".
type
instance-attribute
What kind of axis this is: "space", "time", or "channel".
Recommended.
Methods:
SpaceAxis
SpaceAxis(name: str | bytes, type: str | bytes = MISSING, unit: str | bytes = MISSING, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
TimeAxis
TimeAxis(name: str | bytes, type: str | bytes = MISSING, unit: str | bytes = MISSING, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
ChannelAxis
ChannelAxis(name: str | bytes, type: str | bytes = MISSING, unit: str | bytes = MISSING, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
abczarr.ome.v0_5.transformations
abczarr.ome.v0_5.transformations
Coordinate transformations: how a resolution level maps to physical space.
Classes
CoordinateTransformation
CoordinateTransformation(type: str | bytes, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
A transformation from array indices to physical coordinates.
Build Scale or
Translation directly
rather than this base class. Constructing a CoordinateTransformation
with type="scale" or type="translation" returns the matching one.
Attributes
type
class-attribute
instance-attribute
type: Required[str] = field(factory=False)
Which kind of transformation this is: "scale" or
"translation".
Methods:
Translation
Translation(type: Literal['translation'] = 'translation', translation: Iterable[Real | floating | bool], *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: CoordinateTransformation
An offset, one value per axis, in the axes' physical units.
Scale
Scale(type: Literal['scale'] = 'scale', scale: Iterable[Real | floating | bool], *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: CoordinateTransformation
A per-axis scale factor from array indices to physical units.
For a resolution level, the scale factor is the physical size of one array element along each axis. It turns a pixel index into a physical unit such as a micrometer, and it makes coarser levels of a pyramid line up with the finest one.
abczarr.ome.v0_5.plates
abczarr.ome.v0_5.plates
A high-content screening plate: its rows, columns, wells, and acquisitions.
Classes
Plate
Plate(acquisitions: Iterable[Acquisition | JsonDict | int] = MISSING, columns: Iterable[Column | JsonDict | str], field_count: Integral | integer | bool = MISSING, name: str | bytes = MISSING, rows: Iterable[Row | JsonDict | str], wells: Iterable[Well | JsonDict | str], *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
A high-content screening plate.
rows and columns name the plate's grid, such as "A", "B", and
so on for rows, and "1", "2", and so on for columns.
Attributes
acquisitions
instance-attribute
acquisitions: Optional[list[Acquisition]]
The imaging runs the wells' images belong to, when the screen ran more than one. Optional.
field_count
instance-attribute
The largest number of fields of view acquired for any well of the plate. Recommended.
wells
instance-attribute
wells: Required[list[Well]]
Every well of the plate, each placed in the grid and pointing at the group holding its images.
Classes
Acquisition
Acquisition(id: Integral | integer | bool, name: str | bytes = MISSING, maximumfieldcount: Integral | integer | bool = MISSING, description: str | bytes = MISSING, starttime: Integral | integer | bool = MISSING, endtime: Integral | integer | bool = MISSING, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
One imaging run over some or all of the plate's wells.
class-attribute
instance-attribute
A non-negative integer identifying the acquisition. A Well.Image refers to this run by this value.
instance-attribute
The largest number of fields of view acquired for any well in this run. Recommended.
instance-attribute
description: Optional[str]
A description of the acquisition. Optional.
instance-attribute
starttime: Optional[int]
The time the acquisition started, in Unix epoch milliseconds. Optional.
instance-attribute
endtime: Optional[int]
The time the acquisition ended, in Unix epoch milliseconds. Optional.
Column
Column(name: str | bytes, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
One column of the plate's grid, named as it is labeled.
Row
Row(name: str | bytes, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
One row of the plate's grid, named as it is labeled.
Well
Well(path: str | bytes, rowIndex: Integral | integer | bool, columnIndex: Integral | integer | bool, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
One well's position in the plate, and the group holding it.
class-attribute
instance-attribute
The well's group, relative to the plate group, spelled as
"<row>/<column>".
instance-attribute
The well's row, as an index into Plate.rows.
instance-attribute
The well's column, as an index into Plate.columns.
Methods:
abczarr.ome.v0_5.wells
abczarr.ome.v0_5.wells
A well: the images acquired at one position of a screening plate.
Classes
Well
Well(images: Iterable[Image | JsonDict | str], *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
A well's images: one field of view per acquisition run.
A well group holds one subgroup per field of view.
Attributes
images
instance-attribute
images: Required[list[Image]]
The well's fields of view, each naming its subgroup and, when the plate ran more than one acquisition, which acquisition it belongs to.
Classes
Image
Image(path: str | bytes, acquisition: Integral | integer | bool = MISSING, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
One field of view within a well.
class-attribute
instance-attribute
path: Required[str] = field(factory=False)
The image's group, relative to the well group.
instance-attribute
acquisition: Recommended[int]
The id of the Plate.Acquisition this field of view was captured in, when the plate ran more than one. Recommended.
Methods:
abczarr.ome.v0_5.labels
abczarr.ome.v0_5.labels
A segmentation label image: display colors and per-label properties.
Classes
ImageLabel
ImageLabel(colors: Iterable[Color | JsonDict | int] = MISSING, properties: Iterable[Property | JsonDict | int] = MISSING, source: Source | JsonDict | str = MISSING, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
Metadata for a label image: an array whose integer values name segments.
Attach one of these to a label image group alongside its own Multiscale.
Attributes
colors
instance-attribute
colors: Recommended[list[Color]]
The display color for each labeled integer value. Recommended.
properties
instance-attribute
properties: Optional[list[Property]]
Further, application-defined attributes for each labeled value. Optional.
source
instance-attribute
source: Optional[Source]
Where the label image was derived from. Optional.
Classes
Color
Color(label_value: Integral | integer | bool, rgba: tuple[Integral | integer | bool, Integral | integer | bool, Integral | integer | bool, Integral | integer | bool] = MISSING, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
The display color for one label value.
class-attribute
instance-attribute
label_value: Required[int] = field(json='label-value')
The integer value this color applies to.
instance-attribute
The color as red, green, blue, and alpha components, each
from 0 to 255. Optional.
Property
Property(label_value: Integral | integer | bool, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
Extra, application-defined attributes for one label value.
Any key beyond label_value is carried through as extra data.
See OMEMetadata.
class-attribute
instance-attribute
label_value: Required[int] = field(json='label-value')
The integer value these properties apply to.
Source
Source(image: str | bytes = None, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
Where a label image was derived from.
class-attribute
instance-attribute
image: Optional[str] = None
The path of the intensity image this label was derived from, relative to the label image group. Optional.
Methods:
abczarr.ome.v0_5.omero
abczarr.ome.v0_5.omero
Rendering settings: how to display an image's channels.
Classes
Channel
Channel(color: str | bytes, window: Window | JsonDict | float, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
How to render one channel of a multi-channel image.
Attributes
color
instance-attribute
color: Required[str]
The channel's display color, as a hex RGB string such as
"FF0000" for red.
Classes
Window
Window(min: Real | floating | bool, max: Real | floating | bool, start: Real | floating | bool, end: Real | floating | bool, *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
The intensity range a channel's color is mapped over.
instance-attribute
start: Required[float]
The value a viewer should render at zero intensity. This may
narrow the range min and max bound.
instance-attribute
end: Required[float]
The value a viewer should render at full intensity. This may
narrow the range min and max bound.
Methods:
Omero
Omero(channels: Iterable[Channel | JsonDict | str], *, extra_items: Iterable[tuple[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None]] | Mapping[str | bytes, Real | floating | bool | bool | int | str | bytes | Iterable[()] | None] = FrozenDict({}))
Bases: OMEMetadata
Rendering settings for an image: one entry per channel.
Attach one of these to an image group, alongside its Multiscale, to suggest how a viewer should display it.