Skip to content

yaozarrs.v06#

Specification: https://ngff.openmicroscopy.org/specifications/0.6/

Schema: https://github.com/ome/ngff-spec/tree/89da1da5b0491f83b7cdde7d123aef763a457029/schemas

Coming from v0.5?

In v0.6, axes live in named coordinate systems, and transformations link them together. See Coordinate Systems & Transformations for an introduction.

Images#

Image #

Top-level OME-NGFF image metadata (ome in an image group's zarr.json).

Contains one or more multiscale pyramids, plus optional OMERO rendering hints.

Typical Structure

my_image/
├── zarr.json          # contains ["ome"]["multiscales"]
├── 0/                 # Highest resolution array
├── 1/                 # Next resolution level
└── labels/            # Optional segmentation masks
    ├── zarr.json      # contains ["ome"]["labels"]
    └── 0              # Multiscale, labeled image.

Note

For the optional labels group, see LabelsGroup.

Parameters:

Name Type Description Default
version Literal[0.6, '0.6rc0', dev4]

OME-NGFF version

'0.6'
multiscales list[Multiscale]

One or more multiscale image pyramids in this group

required
omero Omero | None

Optional OMERO rendering metadata for visualization

None

Multiscale #

A multi-resolution image pyramid, with its coordinate systems.

All datasets (resolution levels) map into the same "intrinsic" coordinate system, which represents the image in its native physical coordinates. Additional coordinateTransformations may link the intrinsic coordinate system to other coordinate systems of this multiscale, or to those of its label images.

Parameters:

Name Type Description Default
name str | None

Name of the multiscale image.

None
coordinateSystems list[CoordinateSystem]

Coordinate systems of this multiscale image.

required
datasets list[Dataset]

Resolution levels, ordered from highest to lowest resolution.

required
coordinateTransformations list[IdentityTransformation | MapAxisTransformation | ProjectAxisTransformation | TranslationTransformation | ScaleTransformation | AffineTransformation | RotationTransformation | SequenceTransformation | ByDimensionTransformation | BijectionTransformation | DisplacementsTransformation | CoordinatesTransformation] | None

Transformations between the intrinsic coordinate system and other coordinate systems (of this multiscale or of its label images).

None
type str | None

Downsampling method used to generate the multiscale image.

None
metadata dict[str, Any] | None

Additional metadata about the downsampling method.

None

intrinsic_coordinate_system property #

intrinsic_coordinate_system: CoordinateSystem

The coordinate system that all datasets map into.

axes property #

axes: list[Axis]

Axes of the intrinsic coordinate system (one per array dimension).

ndim property #

ndim: int

Number of dimensions of the image.

from_dims classmethod #

from_dims(
    dims: Sequence[DimSpec],
    name: str | None = None,
    n_levels: int = 1,
    coordinate_system: str = "intrinsic",
) -> Self

Convenience constructor: Create Multiscale from a sequence of DimSpec.

Parameters:

Name Type Description Default
dims Sequence[DimSpec]

A sequence of dimension specifications defining the image dimensions. Must follow OME-Zarr axis ordering: [time,] [channel,] space...

required
name str | None

Name for the multiscale. Default is None.

None
n_levels int

Number of resolution levels in the pyramid. Default is 1.

1
coordinate_system str

Name of the (intrinsic) coordinate system that all resolution levels map into. Default is "intrinsic".

'intrinsic'

Returns:

Type Description
Multiscale

A fully configured Multiscale model.

Examples:

>>> from yaozarrs import DimSpec, v06
>>> dims = [
...     DimSpec(name="t", size=512, unit="second"),
...     DimSpec(
...         name="z", size=50, scale=2.0, unit="micrometer", scale_factor=1.0
...     ),
...     DimSpec(name="y", size=512, scale=0.5, unit="micrometer"),
...     DimSpec(name="x", size=512, scale=0.5, unit="micrometer"),
... ]
>>> ms = v06.Multiscale.from_dims(dims, name="my_multiscale", n_levels=3)
>>> [ds.path for ds in ms.datasets]
['0', '1', '2']
Source code in src/yaozarrs/v06/_image.py
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
@classmethod
def from_dims(
    cls,
    dims: Sequence[DimSpec],
    name: str | None = None,
    n_levels: int = 1,
    coordinate_system: str = "intrinsic",
) -> Self:
    """Convenience constructor: Create Multiscale from a sequence of DimSpec.

    Parameters
    ----------
    dims : Sequence[DimSpec]
        A sequence of dimension specifications defining the image dimensions.
        Must follow OME-Zarr axis ordering: `[time,] [channel,] space...`
    name : str | None, optional
        Name for the multiscale. Default is None.
    n_levels : int, optional
        Number of resolution levels in the pyramid. Default is 1.
    coordinate_system : str, optional
        Name of the (intrinsic) coordinate system that all resolution levels map
        into. Default is "intrinsic".

    Returns
    -------
    Multiscale
        A fully configured Multiscale model.

    Examples
    --------
    >>> from yaozarrs import DimSpec, v06
    >>> dims = [
    ...     DimSpec(name="t", size=512, unit="second"),
    ...     DimSpec(
    ...         name="z", size=50, scale=2.0, unit="micrometer", scale_factor=1.0
    ...     ),
    ...     DimSpec(name="y", size=512, scale=0.5, unit="micrometer"),
    ...     DimSpec(name="x", size=512, scale=0.5, unit="micrometer"),
    ... ]
    >>> ms = v06.Multiscale.from_dims(dims, name="my_multiscale", n_levels=3)
    >>> [ds.path for ds in ms.datasets]
    ['0', '1', '2']
    """
    layout = _coordinate_systems_datasets(dims, n_levels, coordinate_system)
    return cls.model_validate({"name": name, **layout})

Dataset #

A single resolution level in a multiscale image pyramid.

Points to a Zarr array, and maps its array coordinates to the multiscale's "intrinsic" coordinate system with a single transformation.

Parameters:

Name Type Description Default
path str

Path to the Zarr array for this resolution level, relative to the multiscale group.

required
coordinateTransformations list[ScaleTransformation | IdentityTransformation | SequenceTransformation]

Exactly one transformation (scale, identity, or a sequence of a scale followed by a translation) from the array to the intrinsic coordinate system.

required

transform property #

transform: DatasetTransformation

The transformation from this dataset's array to the intrinsic system.

output_name property #

output_name: str

Name of the (intrinsic) coordinate system this dataset maps into.

scale_transform property #

scale_transform: ScaleTransformation | None

The scale transformation (alone or in a sequence), if any.

translation_transform property #

translation_transform: TranslationTransformation | None

The translation transformation (in a sequence), if any.

Coordinate Systems#

CoordinateSystem #

A named set of axes in which coordinates (e.g. physical positions) are expressed.

Coordinate transformations map points between coordinate systems, referring to them by name.

Parameters:

Name Type Description Default
name str

Name of the coordinate system.

required
axes list[Axis]

The axes of this coordinate system.

required

ndim property #

ndim: int

Number of axes (dimensions) in this coordinate system.

Axis #

A dimension (axis) of a coordinate system.

SpaceAxis, TimeAxis and ChannelAxis build one with the type filled in (SpaceAxis and TimeAxis also hint, for IDEs, the units the spec recommends for space and time axes).

Parameters:

Name Type Description Default
name str

The name of the axis.

required
type Literal['array', 'space', 'time', 'channel', 'coordinate', 'displacement'] | str | None

The type of the axis.

None
unit str | None

Physical unit of the axis.

None
longName str | None

A longer name or description of the axis.

None
discrete bool | None

Whether the axis is discrete (may only be indexed by integers, e.g. channels) rather than continuous (interpolation is well-defined).

None

SpaceAxis #

SpaceAxis(
    *,
    name: str,
    type: Literal["space"] = "space",
    unit: ValidSpaceUnit | str | None = None,
    longName: str | None = None,
    discrete: bool | None = None,
) -> Axis

An Axis with type="space".

Source code in src/yaozarrs/v06/_axes.py
75
76
77
78
79
80
81
82
83
84
85
def SpaceAxis(
    *,
    name: str,
    type: Literal["space"] = "space",
    unit: ValidSpaceUnit | str | None = None,
    longName: str | None = None,
    discrete: bool | None = None,
) -> Axis:
    """An `Axis` with `type="space"`."""
    fields = {"type": type, "unit": unit, "longName": longName, "discrete": discrete}
    return build_axis(Axis, "space", name=name, **fields)

TimeAxis #

TimeAxis(
    *,
    name: str,
    type: Literal["time"] = "time",
    unit: ValidTimeUnit | str | None = None,
    longName: str | None = None,
    discrete: bool | None = None,
) -> Axis

An Axis with type="time".

Source code in src/yaozarrs/v06/_axes.py
88
89
90
91
92
93
94
95
96
97
98
def TimeAxis(
    *,
    name: str,
    type: Literal["time"] = "time",
    unit: ValidTimeUnit | str | None = None,
    longName: str | None = None,
    discrete: bool | None = None,
) -> Axis:
    """An `Axis` with `type="time"`."""
    fields = {"type": type, "unit": unit, "longName": longName, "discrete": discrete}
    return build_axis(Axis, "time", name=name, **fields)

ChannelAxis #

ChannelAxis(
    *,
    name: str,
    type: Literal["channel"] = "channel",
    unit: str | None = None,
    longName: str | None = None,
    discrete: bool | None = None,
) -> Axis

An Axis with type="channel".

Source code in src/yaozarrs/v06/_axes.py
101
102
103
104
105
106
107
108
109
110
111
def ChannelAxis(
    *,
    name: str,
    type: Literal["channel"] = "channel",
    unit: str | None = None,
    longName: str | None = None,
    discrete: bool | None = None,
) -> Axis:
    """An `Axis` with `type="channel"`."""
    fields = {"type": type, "unit": unit, "longName": longName, "discrete": discrete}
    return build_axis(Axis, "channel", name=name, **fields)

CustomAxis #

CustomAxis(
    *,
    name: str,
    type: Literal["array", "coordinate", "displacement"]
    | str
    | None = None,
    unit: str | None = None,
    longName: str | None = None,
    discrete: bool | None = None,
) -> Axis

Deprecated: the same as Axis (use that instead).

Source code in src/yaozarrs/v06/_axes.py
114
115
116
117
118
119
120
121
122
123
124
125
@deprecated("`CustomAxis` is deprecated: use `Axis` instead (it's the same).")
def CustomAxis(
    *,
    name: str,
    type: Literal["array", "coordinate", "displacement"] | str | None = None,
    unit: str | None = None,
    longName: str | None = None,
    discrete: bool | None = None,
) -> Axis:
    """Deprecated: the same as [`Axis`][yaozarrs.v06.Axis] (use that instead)."""
    fields = {"type": type, "unit": unit, "longName": longName, "discrete": discrete}
    return build_axis(Axis, None, name=name, **fields)

validate_multiscale_axes #

validate_multiscale_axes(axes: Sequence[Axis]) -> None

Rules for the axes of coordinate systems inside multiscales metadata.

Raises:

Type Description
ValueError

If the axes violate any of the rules.

Source code in src/yaozarrs/v06/_axes.py
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
def validate_multiscale_axes(axes: Sequence[Axis]) -> None:
    """Rules for the axes of coordinate systems inside `multiscales` metadata.

    Raises
    ------
    ValueError
        If the axes violate any of the rules.
    """
    # NOTE: the prose says these rules "apply to all coordinate systems inside
    # multiscales metadata", including "`axes` MUST contain 2 or 3 entries of
    # `type:space`".  But axes.schema allows either 2-3 "space" axes or >= 2 "array"
    # axes, so we accept the latter with a warning.
    # (only the space-axis rule is relaxed for those; the other rules still apply)
    n_space = sum(ax.type == "space" for ax in axes)
    array_cs = sum(ax.type == "array" for ax in axes) >= 2 and not 2 <= n_space <= 3
    if array_cs:
        warn(
            "Coordinate systems inside multiscales MUST contain 2 or 3 axes of type "
            "'space' according to the spec prose; coordinate systems made of 'array' "
            "axes are only allowed by the JSON schema.",
            stacklevel=2,
        )

    # The length of `axes` must be between 2 and 5
    if not 2 <= len(axes) <= 5:
        raise ValueError(f"There must be between 2 and 5 axes. Found {len(axes)}.")

    # `axes` MUST contain 2 or 3 entries of `type:space`
    if not array_cs and not 2 <= n_space <= 3:
        raise ValueError("There must be 2 or 3 axes of type 'space'.")
    # `axes` MAY contain one additional entry of `type:time`
    if sum(ax.type == "time" for ax in axes) > 1:
        raise ValueError("There can be at most 1 axis of type 'time'.")
    # `axes` MAY contain one additional entry of `type:channel` or a null / custom type.
    # NOTE: read literally, that's one channel *or* custom axis.  Like v05, we
    # deliberately still accept one channel axis *plus* one custom axis, since
    # ome-zarr-py and ome-zarr-models both write that.  "custom" means a type outside
    # the ones the spec lists (`AxisType`).
    if sum(ax.type == "channel" for ax in axes) > 1:
        raise ValueError("There can be at most 1 axis of type 'channel'.")
    if sum(ax.type not in get_args(AxisType) for ax in axes) > 1:
        raise ValueError("There can be at most 1 axis with a null or custom type.")

    # `axes` entries MUST be ordered by `type` where the `time` axis must come first
    # (if present), followed by the `channel` or custom axis (if present) and the
    # axes of type `space`.
    type_order = {"time": 0, "space": 2}
    order = [type_order.get(ax.type or "", 1) for ax in axes]
    if order != sorted(order):
        raise ValueError(
            "Axes are not in the required order by type. "
            "Order must be [time,] [channel or custom,] space."
        )

Transformations#

CoordinateSystemRef #

Reference to a coordinate system: the input or output of a transformation.

Which of name and path are required depends on where the transformation is stored (dataset, multiscale, or scene); the containing model checks that. If path is omitted (or null), name refers to a coordinate system in the same zarr.json document.

Parameters:

Name Type Description Default
name str | None

Coordinate system name.

None
path str | None

Path to the Zarr group (or array) defining the coordinate system, if not in the same document.

None

IdentityTransformation #

Maps input coordinates to output coordinates without modification.

Parameters:

Name Type Description Default
type Literal['identity']
'identity'

MapAxisTransformation #

Axis permutation: mapAxis[i] is the input axis that becomes output axis i.

Parameters:

Name Type Description Default
type Literal['mapAxis']
'mapAxis'
mapAxis list[int]

New axis order, as zero-based indices of the input axes.

required

ProjectAxisTransformation #

Adds and/or drops dimensions at specified indices of the coordinate vector.

Parameters:

Name Type Description Default
type Literal['projectAxis']
'projectAxis'
droppedInputs list[int] | None

Indices of the input coordinate vector that are dropped.

None
createdOutputs list[int] | None

Indices of the output coordinate vector that are added (as 0).

None

TranslationTransformation #

Translates coordinates by a fixed offset along each axis.

Parameters:

Name Type Description Default
type Literal['translation']
'translation'
translation list[float]

Offset for each axis.

required

ScaleTransformation #

Scales coordinates by a factor along each axis.

Parameters:

Name Type Description Default
type Literal['scale']
'scale'
scale list[float]

Scale factor for each axis.

required

AffineTransformation #

Affine transformation, as an (M)x(N+1) matrix inline or in a Zarr array.

Parameters:

Name Type Description Default
type Literal['affine']
'affine'
affine list[list[float]] | None

(M)x(N+1) matrix, as a list of M rows (for N input axes).

None
path str | None

Path to a 2D Zarr array holding the matrix.

None

RotationTransformation #

Rotation, as an NxN matrix inline or in a Zarr array.

Parameters:

Name Type Description Default
type Literal['rotation']
'rotation'
rotation list[list[float]] | None

NxN rotation matrix, as a list of N rows.

None
path str | None

Path to a 2D Zarr array holding the matrix.

None

SequenceTransformation #

Applies an ordered list of transformations, first to last.

Parameters:

Name Type Description Default
type Literal['sequence']
'sequence'
transformations list[IdentityTransformation | MapAxisTransformation | ProjectAxisTransformation | TranslationTransformation | ScaleTransformation | AffineTransformation | RotationTransformation | SequenceTransformation | ByDimensionTransformation | BijectionTransformation | DisplacementsTransformation | CoordinatesTransformation]

Transformations to apply, in order (non-empty).

required

ByDimensionTransformation #

Builds a transformation from lower-dimensional ones on subsets of axes.

Parameters:

Name Type Description Default
type Literal['byDimension']
'byDimension'
transformations list[ByDimensionItem]

Transformations and the axes they apply to (non-empty).

required

ByDimensionItem #

A lower-dimensional transformation applied to a subset of axes.

Parameters:

Name Type Description Default
transformation IdentityTransformation | MapAxisTransformation | ProjectAxisTransformation | TranslationTransformation | ScaleTransformation | AffineTransformation | RotationTransformation | SequenceTransformation | ByDimensionTransformation | BijectionTransformation | DisplacementsTransformation | CoordinatesTransformation

The transformation to apply to the selected axes.

required
inputAxes list[int]

Indices of the parent's input axes this transformation reads.

required
outputAxes list[int]

Indices of the parent's output axes this transformation writes.

required

BijectionTransformation #

An invertible transformation with explicit forward and inverse.

Parameters:

Name Type Description Default
type Literal['bijection']
'bijection'
forward ForwardRef(CoordinateTransformation)

The forward transformation.

required
inverse ForwardRef(CoordinateTransformation)

The inverse transformation.

required

DisplacementsTransformation #

Displacement field: output = input + displacement vector at that point.

Parameters:

Name Type Description Default
type Literal['displacements']
'displacements'

CoordinatesTransformation #

Coordinate field: output = coordinate vector stored at the input point.

Parameters:

Name Type Description Default
type Literal['coordinates']
'coordinates'

check_transform_ndim #

check_transform_ndim(
    t: CoordinateTransformation, n_in: int, n_out: int
) -> None

Check that the parameters of t fit n_in input and n_out output axes.

Raises:

Type Description
ValueError

If they don't.

Source code in src/yaozarrs/v06/_transforms.py
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
def check_transform_ndim(t: CoordinateTransformation, n_in: int, n_out: int) -> None:
    """Check that the parameters of `t` fit `n_in` input and `n_out` output axes.

    Raises
    ------
    ValueError
        If they don't.
    """

    # The parameter values ... MUST be compatible with input and output space
    # dimensionality
    def _fail(msg: str) -> NoReturn:
        raise ValueError(f"{t.type}: {msg} (input has {n_in}, output has {n_out} axes)")

    if isinstance(t, (TranslationTransformation, ScaleTransformation)):
        # Input and output dimensionality MUST be identical and MUST equal the
        # length of the `scale`/`translation` array (N).
        params = t.translation if isinstance(t, TranslationTransformation) else t.scale
        if not len(params) == n_in == n_out:
            _fail(f"has {len(params)} values")
    elif isinstance(t, (IdentityTransformation, DisplacementsTransformation)):
        # (`displacements` require M=N)
        if n_in != n_out:
            _fail("input and output must have the same number of axes")
    elif isinstance(t, MapAxisTransformation):
        # The length of the array MUST equal the number of dimensions in both the
        # input and output coordinate systems. Each integer in the array MUST be a
        # valid zero-based index into the input coordinate system's axes
        # (that it's a permutation of 0..N-1 is checked by MapAxisTransformation)
        if not len(t.mapAxis) == n_in == n_out:
            _fail(f"has {len(t.mapAxis)} indices")
    elif isinstance(t, ProjectAxisTransformation):
        dropped, created = t.droppedInputs or [], t.createdOutputs or []
        if any(i >= n_in for i in dropped):
            _fail(f"droppedInputs {dropped} out of range")
        if any(i >= n_out for i in created):
            _fail(f"createdOutputs {created} out of range")
        if n_out != n_in - len(dropped) + len(created):
            _fail(f"drops {len(dropped)} and creates {len(created)} axes")
    elif isinstance(t, AffineTransformation):
        # the outer array MUST be length `M` and the inner arrays MUST be length N+1
        if t.affine is not None:
            m, n1 = len(t.affine), len(t.affine[0])
            if m != n_out or n1 != n_in + 1:
                _fail(f"matrix is {m}x{n1}, expected {n_out}x{n_in + 1}")
    elif isinstance(t, RotationTransformation):
        # Input and output dimensionality (N) MUST be identical.
        if n_in != n_out:
            _fail("input and output must have the same number of axes")
        if t.rotation is not None and len(t.rotation) != n_in:
            _fail(f"matrix is {len(t.rotation)}x{len(t.rotation)}")
    elif isinstance(t, BijectionTransformation):
        # Its input and output spaces MUST have equal dimension. The input and
        # output dimensions for the both the forward and inverse transformations
        # MUST match bijection's input and output space dimensions.
        if n_in != n_out:
            _fail("input and output must have the same number of axes")
        _check_child(t, "forward", t.forward, n_in, n_out)
        _check_child(t, "inverse", t.inverse, n_out, n_in)
    elif isinstance(t, SequenceTransformation):
        # (intermediate dimensionality is inferred from each step's parameters. Where
        # it can't be (e.g. after a `coordinates` step), checking resumes at the next
        # step whose parameters fix its own input size. The last step must produce
        # the sequence's output.)
        n: int | None = n_in
        steps = t.transformations
        for i, step in enumerate(steps):
            if n is None:
                n = _own_ndim(step)[0]
            n_next = n_out if i == len(steps) - 1 else _output_ndim(step, n)
            if n is not None and n_next is not None:
                _check_child(t, f"transformations[{i}]", step, n, n_next)
            n = n_next
    elif isinstance(t, ByDimensionTransformation):
        # The integer values in these arrays correspond to the axis indices in the
        # `byDimension`'s ... `input` and `output` coordinate systems
        for i, item in enumerate(t.transformations):
            if any(ax >= n_in for ax in item.inputAxes):
                _fail(f"transformations[{i}].inputAxes {item.inputAxes} out of range")
            if any(ax >= n_out for ax in item.outputAxes):
                _fail(f"transformations[{i}].outputAxes {item.outputAxes} out of range")
        # Every axis index in the parent byDimension's `output` coordinate system
        # MUST appear in exactly one child transformation's `outputAxes` array.
        covered = {ax for item in t.transformations for ax in item.outputAxes}
        if missing := sorted(set(range(n_out)) - covered):
            _fail(f"output axes {missing} are not covered by any transformation")

Omero (display metadata)#

yaozarrs.v06.Omero #

Optional OMERO rendering metadata for visualization.

Provides display hints for viewers, including channel colors, intensity windows, and default viewing parameters. This metadata is transitional and may be replaced in future OME-NGFF versions.

Transitional Metadata

The OMERO metadata is inherited from OME-NGFF 0.4 and maintained for backwards compatibility. The spec acknowledges this needs improvement.

Extra Fields Allowed

This model permits additional fields beyond those explicitly defined, as the full OMERO metadata structure is extensive and evolving.

Parameters:

Name Type Description Default
channels list[OmeroChannel]

Rendering settings for each channel in the image

required
id int | None

OMERO image ID (if from an OMERO server)

None
name str | None

Image name from OMERO

None
version str | None

OMERO metadata version

None
rdefs OmeroRenderingDefs | None

Default rendering parameters for multi-dimensional viewing

None

yaozarrs.v06.OmeroChannel #

Rendering settings for a single channel.

Specifies how to display one channel of a multi-channel image, including color mapping, intensity windowing, and visibility.

Parameters:

Name Type Description Default
window OmeroWindow

Intensity window for this channel

required
label str | None

Human-readable name for this channel (e.g., 'DAPI', 'GFP')

None
family str | None

Colormap family (typically 'linear' for fluorescence)

None
color str

Display color as hex string without # (e.g., 'FF0000' for red)

required
active bool | None

Whether this channel is visible by default

None
inverted bool | None

Whether to invert the intensity mapping

None
coefficient float | None

Multiplicative coefficient for intensity scaling

None

yaozarrs.v06.OmeroWindow #

Display intensity window for a channel.

Defines how pixel intensities map to display brightness. The window sets both the current display range (start/end) and the allowed range (min/max).

Parameters:

Name Type Description Default
start float

Lower bound of the current display window

required
min float

Minimum allowed intensity value for this channel

required
end float

Upper bound of the current display window

required
max float

Maximum allowed intensity value for this channel

required

yaozarrs.v06.OmeroRenderingDefs #

Default rendering parameters for multi-dimensional images.

Specifies which slices to display by default in time-lapse or z-stack images, and how to render them (color vs grayscale, projection method).

Parameters:

Name Type Description Default
model Literal['color', 'greyscale'] | str | None

Rendering mode: 'color' for multi-channel composite, 'greyscale' for single channel

None
defaultT int | None

Default time point index to display

None
defaultZ int | None

Default z-section index to display

None
projection str | None

Projection method for z-stacks: 'normal', 'intmax' (max intensity), or 'intmean'

None

Labels#

LabelImage #

A complete label image with multiscale pyramids and label metadata.

Combines the standard image structure (multiscale pyramids, coordinate systems, etc.) with label-specific metadata (colors, properties, source reference). Label images must use integer data types.

Relationship to Image

This is an Image with additional image-label metadata. The multiscale pyramids follow the same structure as regular images but contain integer segmentation masks instead of intensity data.

Parameters:

Name Type Description Default
image_label ImageLabel

Label-specific metadata (colors, properties, source link)

required

ImageLabel #

Metadata for a segmentation/annotation label image.

Enhances a multiscale label image with display colors, semantic properties, and links back to the source intensity image. Label images are integer-valued arrays where each unique value represents a distinct object or region.

Note

Unlike v0.5, image-label no longer has its own version key in v0.6.

Parameters:

Name Type Description Default
colors list[LabelColor] | None

Color mappings for label values, used for visualization

None
properties list[LabelProperty] | None

Arbitrary metadata properties for individual label values

None
source LabelSource | None

Reference to the source intensity image that was segmented

None

LabelColor #

Display color mapping for a label value.

Associates a specific label integer value with an RGBA color for visualization purposes.

Parameters:

Name Type Description Default
label_value int

Integer label value from the segmentation image

required
rgba list[int] | None

RGBA color as [red, green, blue, alpha], each 0-255

None

LabelProperty #

Custom metadata for a label value.

Associates arbitrary key-value properties with a specific label integer. Different labels can have different sets of properties - there's no requirement for consistency across labels.

Example

LabelProperty(label_value=1, cell_type="neuron", area=1250.5)
LabelProperty(label_value=2, cell_type="glia", perimeter=180.3)

Parameters:

Name Type Description Default
label_value int

Integer label value from the segmentation image

required

LabelSource #

Reference to the source image that was segmented.

Points back to the original intensity image from which this label image was derived.

Parameters:

Name Type Description Default
image str | None

Relative path to the source image group (default: '../../', pointing to the parent of the labels/ directory)

'../../'

LabelsGroup #

Top-level labels collection metadata.

This model corresponds to the ome metadata in the zarr.json of a labels/ group, which acts as a container for multiple segmentation/annotation images.

Typical Structure

my_image/
├── zarr.json          # Image metadata
├── s0/                # Image arrays
└── labels/
    ├── zarr.json      # Contains this metadata
    ├── cells/         # One label image
    └── nuclei/        # Another label image

Parameters:

Name Type Description Default
version Literal[0.6, '0.6rc0', dev4]

OME-NGFF version

'0.6'
labels list[str]

Paths to individual label image groups within this collection

required

Plates#

Plate #

Top-level plate metadata for high-content screening.

This model corresponds to the ome metadata in a plate group's zarr.json, organizing a microplate's wells in a grid layout. Each well contains one or more fields-of-view, which in turn contain multiscale images.

Typical Structure

my_plate.ome.zarr
├── A                       # Row A
│   ├── 1                   # Column 1
│   │   ├── 0               # FOV 0 (in A1)
│   │   │   ├── s0          # FOV 0 - Multiscale level 0
│   │   │   └── zarr.json   # contains ["ome"]["multiscales"]
│   │   ├── 1               # FOV 1 (in A1)
│   │   │   └── ...
│   │   └── zarr.json       # well metadata (contains ['ome']['well'])
│   └── 2
│       └── ...
├── B
│   └── ...
└── zarr.json                # plate metadata (contains ['ome']['plate'])

Note

See also:

Parameters:

Name Type Description Default
version Literal['0.6', '0.6rc0', '0.6.dev4']

OME-NGFF version

'0.6'
plate PlateDef

Plate layout and well organization

required
bioformats2raw_layout Literal[3] | None

Marker indicating this plate was created by bioformats2raw version 3

None

PlateDef #

Plate layout and well organization.

Defines the grid structure of a microplate and maps wells to their data. This is the core content of the plate metadata field.

Parameters:

Name Type Description Default
columns list[Column]

Column definitions for the plate grid

required
rows list[Row]

Row definitions for the plate grid

required
wells list[PlateWell]

List of all wells present in this plate with their grid positions

required
acquisitions list[Acquisition] | None

Imaging acquisition runs performed on this plate

None
field_count int | None

Maximum number of fields-of-view per well across the entire plate

None
name str | None

Human-readable name for this plate

None

Column #

A column in the plate grid.

Columns are typically numbered (1, 2, 3, ...) but can use any alphanumeric identifier.

Parameters:

Name Type Description Default
name str

Column identifier (typically numeric, e.g., '1', '2', '3')

required

Row #

A row in the plate grid.

Rows are typically lettered (A, B, C, ...) but can use any alphanumeric identifier.

Parameters:

Name Type Description Default
name str

Row identifier (typically alphabetic, e.g., 'A', 'B', 'C')

required

PlateWell #

A well location reference within a plate.

Maps a well's row/column position to its data location. This is a lightweight reference used in plate metadata, not the full well group (see the top-level Well model for the complete well metadata).

Parameters:

Name Type Description Default
path str

Relative path to the well's group (format: 'row/column', e.g., 'A/1')

required
rowIndex int

Zero-based index into the plate's rows list

required
columnIndex int

Zero-based index into the plate's columns list

required

Acquisition #

An imaging acquisition run within a plate.

In high-content screening, multiple acquisition runs may be performed on the same plate (e.g., at different timepoints or with different settings). This class groups related images from a single acquisition session.

Parameters:

Name Type Description Default
id int

Unique identifier within the plate for this acquisition

required
maximumfieldcount int | None

Maximum number of fields-of-view across all wells in this acquisition

None
name str | None

Human-readable name for this acquisition

None
description str | None

Detailed description of the acquisition parameters or purpose

None
starttime int | None

Acquisition start time as Unix epoch timestamp (seconds since 1970-01-01)

None
endtime int | None

Acquisition end time as Unix epoch timestamp (seconds since 1970-01-01)

None

Well #

Top-level well metadata within a plate.

This model corresponds to the ome metadata in a well group's zarr.json. It lists all fields-of-view (imaging positions) captured within this well.

Typical Structure

A/1/                   # Well at row A, column 1
├── zarr.json          # Contains this metadata
├── 0/                 # First field-of-view
│   ├── zarr.json      # Image metadata
│   ├── s0/            # Highest resolution
│   └── s1/            # Next resolution
└── 1/                 # Second field-of-view

Parameters:

Name Type Description Default
version Literal['0.6', '0.6rc0', '0.6.dev4']

OME-NGFF version

'0.6'
well WellDef

Field-of-view organization for this well

required

WellDef #

Organization of fields-of-view within a well.

This is the core content of the well metadata field, listing all imaging positions captured for this well.

Parameters:

Name Type Description Default
images list[FieldOfView]

List of all fields-of-view imaged in this well

required

FieldOfView #

A single field-of-view (imaging position) within a well.

Wells typically contain multiple fields-of-view when the well area is larger than a single camera frame. Each field-of-view is a complete multiscale image.

This class appears within the images list of a WellDef.

Parameters:

Name Type Description Default
path str

Relative path to this field's image group (typically a number like '0', '1', etc.)

required
acquisition int | None

Acquisition ID linking this field to a specific acquisition run. Required when the parent plate has multiple acquisitions.

None

Collections#

Bf2Raw #

Model for zarr.json in a group representing multi-series image collections.

The bioformats2raw layout is a transitional specification for filesets that already exist in the wild. An upcoming NGFF specification will replace this layout with explicit metadata. It is currently the only way to represent multi-position image collections, and it has a recommended place for OME-XML metadata.

Typical Structure

root.ome.zarr             # One converted fileset from bioformats2raw
├── zarr.json             # Contains "bioformats2raw.layout" metadata
├── OME                   # Special group for containing OME metadata
│   ├── zarr.json         # Contains "series" metadata
│   └── METADATA.ome.xml  # OME-XML file stored within the Zarr fileset
├── 0                     # First image in the collection
├── 1                     # Second image in the collection
└── ...

Note

The OME/zarr.json file typically contains Series metadata that explicitly lists image paths. If not present, images MUST be numbered as shown above, starting from 0, e.g., 0/, 1/, 2/, etc.

Parameters:

Name Type Description Default
version Literal['0.6', '0.6rc0', '0.6.dev4']

OME-NGFF version

'0.6'
bioformats2raw_layout Literal[3]

Layout version marker added by bioformats2raw (currently 3)

3

Series #

Model for OME/zarr.json in a Bf2Raw collection.

Used when converting files containing multiple distinct images (e.g., multi-series microscopy formats) to OME-NGFF. Each series becomes a separate image group, and this metadata lists them all.

Note

The spec is ambiguous about whether series is required. This library treats it as required for disambiguation, since otherwise this model would simply contain "version".

Parameters:

Name Type Description Default
version Literal['0.6', '0.6rc0', '0.6.dev4']

OME-NGFF version

'0.6'
series list[str]

Ordered list of paths to image groups, matching the order in the companion OME-XML metadata

required

Scenes#

Scene #

Top-level scene metadata (ome in a scene group's zarr.json).

A scene group contains several multiscale images that share a spatial relationship, described by transformations between their coordinate systems.

Typical Structure

my_scene.zarr
├── zarr.json                  # contains ["ome"]["scene"]
├── imageA/                    # a multiscale image
├── imageB/                    # another multiscale image
└── coordinateTransformations/ # (optional) arrays with transform parameters

Parameters:

Name Type Description Default
version Literal[0.6, '0.6rc0', dev4]

OME-NGFF version

'0.6'
scene SceneDef

Spatial relationships between the images

required

SceneDef #

Spatial relationships between images (the scene object).

Transformations link coordinate systems of multiscale image subgroups (referenced by path and name) to each other, or to coordinate systems defined in the scene itself (referenced by name only).

Parameters:

Name Type Description Default
coordinateTransformations list[IdentityTransformation | MapAxisTransformation | ProjectAxisTransformation | TranslationTransformation | ScaleTransformation | AffineTransformation | RotationTransformation | SequenceTransformation | ByDimensionTransformation | BijectionTransformation | DisplacementsTransformation | CoordinatesTransformation]

Transformations between coordinate systems of the images.

required
coordinateSystems list[CoordinateSystem] | None

Coordinate systems defined by the scene itself (the first one is recommended as the default).

None