Skip to content

OME 0.6: test metadata round trips against the spec test suite - #116

Open
konstibob wants to merge 6 commits into
zarr-developers:mainfrom
konstibob:fix/ome-v06-roundtrip-tests
Open

konstibob wants to merge 6 commits into
zarr-developers:mainfrom
konstibob:fix/ome-v06-roundtrip-tests

Conversation

@konstibob

Copy link
Copy Markdown
Contributor

Builds on #109 and #110 and contains both, merged together; only the last commit is new. The merge commit resolves the conflicts between the two: projectAxis and the displacements/coordinates constructors from #109 still took String refs, which #110 replaces with CoordinateSystemRef, and a #109 test expected two dataset transformations where #110 writes one sequence.

To check that we actually write 0.6 correctly, every 0.6 metadata document we have test data for is now read, written back and compared to the original: the RFC-5 examples (bumped to their final 0.6 state), the valid cases of the official ngff-spec conformance suite (new submodule at tag 0.6) and our scene fixtures, moved from 0.6.dev3 to final 0.6.

With #109 and #110 that passes for almost everything. What was still lost on write:

  • members we don't model, like @id/@type or the omero wavelength_id, are now kept as extra fields, the same way v3.GroupMetadata does it
  • unknown transformation types were written as a nested object, e.g. {"type": "vendorWarp", "strength": 3.5} came back as {"type": "vendorWarp", "raw": {"strength": 3.5}}
  • the axes of an image came from the first coordinate system instead of the intrinsic one the datasets map into; for the projectAxis example of the spec that gave [c, z, y, x] for a 2D image

The legacy test from #110 read the string form from the RFC-5 examples, which no longer have it, so it now uses a small dev3 fixture of its own.

🤖 Generated with Claude Code

konstibob and others added 5 commits September 24, 2026 14:45
…is and series metadata

- getLabels() reads attributes.ome.labels for zarr v3 labels groups (spec
  0.5/0.6), falling back to the legacy attributes.labels; fix the v0.5
  labels fixture to the spec layout.
- Axis serializes longName (spec) and still accepts long_name on read.
- displacements/coordinates transforms keep their interpolation field.
- Model labels, image-label and series in the v0.5 and v0.6 OmeMetadata
  (new shared ImageLabel type; unknown keys in colors/properties are kept).
  createScaleLevel no longer drops ome fields in v0.5.
- Add the projectAxis transform (droppedInputs/createdOutputs).
- byDimension items use inputAxes/outputAxes, accepting the snake_case
  aliases on read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OME-NGFF 0.6 requires the input/output of coordinate transformations to be
JSON objects {"name": ..., "path": ...}. The v0.6 model stored them as
strings, squashing objects into "path#name" on read and writing strings
back, so reading a conformant file and saving it corrupted it. Scale levels
created via createScaleLevel also lacked the mandatory dataset input/output.

- Add CoordinateSystemRef (name/path, NON_NULL) and use it for input/output
  on all v0.6 transformations; factory methods take CoordinateSystemRef and
  gain ref-less scale/translation and a sequence factory.
- Legacy pre-release string refs are still read: a bare string is a name,
  except for the input of a dataset transformation, which is the dataset
  path; "<path>#<name>" strings from earlier zarr-java are split. Writing
  always emits the object form.
- createScaleLevel writes input {"path": <level>} and output
  {"name": <intrinsic>} (from existing datasets, else first coordinate
  system; ZarrException if neither). Multiple transformations are wrapped in
  a sequence whose nested transformations carry no refs; getMultiscaleNode
  flattens such sequences back to [scale, translation].
- Scene graph resolution works on CoordinateSystemRef.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s as {name, path} objects)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves the conflicts between the two PRs: the projectAxis transform and the
convenience constructors of displacements/coordinates from zarr-developers#109 now take
CoordinateSystemRef like every other v0.6 transform after zarr-developers#110, and the zarr-developers#109
test for createScaleLevel expects the single sequence zarr-developers#110 writes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every OME-Zarr 0.6 metadata document we have test data for is now read and
written back, and the result must equal the original: the RFC-5 examples
(bumped to their final 0.6 state), the valid cases of the official ngff-spec
conformance suite (new submodule at tag 0.6) and our scene fixtures, which are
moved from 0.6.dev3 to final 0.6.

The round trip found what was still lost on write:
- members zarr-java does not model on ome, multiscales entries and omero
  channels (@id, @type, wavelength_id) are kept as extra fields
- unknown transformation types were written as a nested "raw" object
- the axes of an image came from the first coordinate system instead of the
  intrinsic one the datasets map into

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves the conflicts with the move of OME-Zarr to dev.zarr.conventions.ome (zarr-developers#78).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant