Skip to content

OME 0.6: write coordinate system references as {name, path} objects - #110

Open
konstibob wants to merge 1 commit into
zarr-developers:mainfrom
konstibob:fix/ome-v06-coordinate-system-refs
Open

konstibob wants to merge 1 commit into
zarr-developers:mainfrom
konstibob:fix/ome-v06-coordinate-system-refs

Conversation

@konstibob

@konstibob konstibob commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

The v0.6 model was built against the 0.6 dev drafts, where transform input/output were strings. The final 0.6 spec requires objects {"name": ..., "path": ...}.

Problem

  • Reading squashed refs into "path#name" strings and wrote them back that way, so saving a conformant file corrupted it (e.g. {"name":"physical","path":"imgA"} → "imgA#physical").
  • createScaleLevel(...) wrote dataset transforms with no input/output at all.

Changes

  • New CoordinateSystemRef (name, path) used for input/output on all v0.6 transforms. Writing always emits the object form.
  • createScaleLevel writes input: {"path": <level>} and output: {"name": <intrinsic>}. Several transforms are wrapped in one sequence, as the spec requires.
  • Scene resolver and graph use the new refs.
  • Old files still open: a bare string is read as a name, except a dataset transform's input, which is read as the path; "path#name" strings are split.

Breaking (experimental package): getInput()/getOutput(), constructors and the scale/translation/identity factories now take CoordinateSystemRef instead of String.

Tests

New OmeZarrV06CoordinateSystemRefTest (spec JSON round-trips, createScaleLevel output, legacy fixtures) plus updated tests. mvn test -Dtest='OmeZarr*Test,OmeObjectMappersTest': 84 tests, 0 failures.

Related: #109 (preserve dropped metadata fields). Whichever merges second needs a small rebase.

🤖 Generated with Claude Code

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