Skip to content

Zarr models

biomero_schema.zarr

Cross-service schemas for BIOMERO-managed Zarr data.

These models describe portable records exchanged by BIOMERO services. They do not implement canonical storage, OMERO access, workflow events, or Zarr I/O.

ZarrContractModel

Bases: BaseModel

Base configuration shared by the Zarr interchange contracts.

to_dict

to_dict() -> dict[str, Any]

Return the stable camelCase wire representation.

from_dict classmethod

from_dict(value: Mapping[str, Any])

Validate a wire representation.

PixelIdentity

Bases: ZarrContractModel

ISCC-BIO identity and semantic guard for one NGFF image or label node.

schema property

schema: int

Wire schema version (kept distinct from workflow schema versions).

CanonicalZarrSource

Bases: ZarrContractModel

Managed locator for a verified canonical Zarr representation.

schema property

schema: int

Wire schema version (kept distinct from workflow schema versions).

to_annotation_values

to_annotation_values() -> dict[str, str]

Encode the record for an OMERO MapAnnotation value map.

from_annotation_values classmethod

from_annotation_values(values: Mapping[str, str]) -> CanonicalZarrSource

Decode and validate an OMERO MapAnnotation value map.

ManagedZarrNode

Bases: ZarrContractModel

Stable managed locator for one physical NGFF image or label node.

ZarrLabelComponent

Bases: ZarrContractModel

One logical label layer and, when inherited, its managed source.

source is absent only while the label pixels are stored locally in the collection that owns this record. A workflow input snapshot always uses a managed source because its reconstructed transfer artifact is temporary.

CanonicalPlateImage

Bases: ZarrContractModel

One image-level node and its labels within a canonical Plate Zarr.

CanonicalPlateSource

Bases: ZarrContractModel

Managed canonical Plate Zarr with independently identified image nodes.

CanonicalPlateIndex

Bases: ZarrContractModel

Compact Plate-level index for split OMERO canonical annotations.

CanonicalPlateImageRecord

Bases: ZarrContractModel

One bounded image-node record belonging to a compact Plate index.

CanonicalPlateLabelRecord

Bases: ZarrContractModel

One bounded label-node record belonging to a compact Plate index.

CanonicalInput

Bases: ZarrContractModel

One selected OMERO object and the exact canonical generation exported.

schema property

schema: int

Wire schema version (kept distinct from workflow schema versions).

CanonicalInputManifest

Bases: ZarrContractModel

Recovery manifest for the canonical inputs exported for one workflow.

schema property

schema: int

Wire schema version (kept distinct from workflow schema versions).

ShallowImageNode

Bases: ZarrContractModel

One logical source-image node in a shallow result collection.

ShallowLabelNode

Bases: ZarrContractModel

One logical label node derived from a source-image node.

ShallowCollection

Bases: ZarrContractModel

Portable scientific relationships in a BIOMERO shallow result.

This graph deliberately excludes managed roots, OMERO identifiers, pixel identities and workflow receipts. It is not RFC-8 metadata; adapters can project the graph to a standards representation when that representation is supported by the selected NGFF profile.

ShallowImageBinding

Bases: ZarrContractModel

BIOMERO storage and identity binding for one logical image node.

ShallowLabelBinding

Bases: ZarrContractModel

BIOMERO storage and identity binding for one logical label node.

ShallowBindings

Bases: ZarrContractModel

Operational bindings kept separate from the scientific graph.

ShallowManifest

Bases: ZarrContractModel

Versioned BIOMERO storage manifest for one shallow result.

image_binding

image_binding(node_id: str) -> ShallowImageBinding

Return the unique operational binding for an image node.

label_bindings_for_image

label_bindings_for_image(image_id: str) -> tuple[ShallowLabelBinding, ...]

Return label bindings related to one image, in graph order.

ShallowPlateReference

Bases: ZarrContractModel

Managed locator attached to a derived OMERO shallow Plate.

The compact Plate-level annotation indexes the authoritative collection manifest without repeating every per-image pixel identity in OMERO. Consumers must load and validate that manifest before reconstruction.

ZarrImportOptions

Bases: ZarrContractModel

Optional per-order controls for registering a BIOMERO Zarr result.

ShallowZarrReference

Bases: ZarrContractModel

Managed locator attached to one OMERO image or label-image projection.

The referenced collection remains the authority. Consumers must load its sidecar and verify that this image/label/source tuple is still present before materializing data.

to_annotation_values

to_annotation_values() -> dict[str, str]

Encode the reference for an OMERO MapAnnotation value map.

from_annotation_values classmethod

from_annotation_values(values: Mapping[str, str]) -> ShallowZarrReference

Decode and validate an OMERO MapAnnotation value map.

from_manifest classmethod

from_manifest(manifest: ShallowManifest, *, storage_root: str, relative_path: str, image_node_path: str, label_node_paths: tuple[str, ...] | None = None) -> ShallowZarrReference

Create a projection reference and require collection membership.

RFC-8 draft projection

biomero_schema.rfc8

Projection boundary for the early OME-NGFF RFC-8 v1 draft.

RFC-8 v1 (2026-08) is not an adopted OME-NGFF specification. This module projects BIOMERO's format-independent collection graph into the draft shape so that alignment can be tested without making draft metadata authoritative or claiming that NGFF 0.4 / Zarr v2 stores are RFC-8 compliant.

Rfc8DraftPath

Bases: ZarrContractModel

A path accepted by the RFC-8 v1 draft projection.

project_rfc8_v1_draft

project_rfc8_v1_draft(manifest: ShallowManifest, *, ome_version: str, image_paths: Mapping[str, Rfc8DraftPath], label_paths: Mapping[str, Rfc8DraftPath]) -> dict

Project a shallow graph into the RFC-8 v1 draft collection shape.

Callers provide paths because BIOMERO managed-storage bindings are not portable RFC paths. Production writers must not use this projection until the selected NGFF profile and referenced stores support the accepted collections specification.