Skip to content

OME: preserve labels, image-label, longName, interpolation, projectAxis and series metadata - #109

Open
konstibob wants to merge 1 commit into
zarr-developers:mainfrom
konstibob:fix/ome-preserve-metadata
Open

konstibob wants to merge 1 commit into
zarr-developers:mainfrom
konstibob:fix/ome-preserve-metadata

Conversation

@konstibob

@konstibob konstibob commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Unmodelled OME fields were dropped on read, so opening and saving a file lost them. This PR models them and fixes where labels is read from.

Changes

  • getLabels(): reads attributes.ome.labels (spec, 0.5/0.6); still accepts the legacy attributes.labels. The v0.5 labels fixture is fixed to the spec layout.
  • Axis longName: written as longName; long_name still accepted on read.
  • interpolation on displacements/coordinates: now kept.
  • labels, image-label, series: added to v0.5 and v0.6 OmeMetadata (new shared ImageLabel with colors, properties, source).
  • projectAxis: new transform class (droppedInputs, createdOutputs).
  • byDimension: inputAxes/outputAxes are canonical; snake_case still accepted.
  • createScaleLevel (v0.5/v0.6) no longer drops omero, bioformats2raw.layout and the new fields.

Tests

Round-trip tests (read spec JSON → write → compare trees) for all of the above. mvn test -Dtest='OmeZarr*Test,OmeObjectMappersTest': 88 tests, 0 failures.

Related: #110 (coordinate system references as {name, path}). Whichever merges second needs a small rebase.

🤖 Generated with Claude Code

…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>
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