Skip to content

Streamline input output constraints#137

Merged
joshmoore merged 19 commits into
ome:mainfrom
jo-mueller:streamline-input-output-constraints
Jul 2, 2026
Merged

Streamline input output constraints#137
joshmoore merged 19 commits into
ome:mainfrom
jo-mueller:streamline-input-output-constraints

Conversation

@jo-mueller

@jo-mueller jo-mueller commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Fixes ome/ngff#523
Fixes #159

  • removes some duplicate text and adds more descriptive tables to the transformations section to make the whole paragraph a bit easier to read.
  • synchronizes the constraints introduced for transformation input/output fields across the spec so that they are progressively narrowed down from broad to context-dependend tight
  • relaxes restriction on directionality in ms > coordinateTransformations, which makes the text cleaner and has no practical implication since we are only allowing identity/scale/translate/sequence here.

cc @btbest

@jo-mueller jo-mueller added the documentation Improvements or additions to documentation label Jun 10, 2026
@github-actions

Copy link
Copy Markdown

Automated Review URLs

@jo-mueller jo-mueller requested a review from clbarnes June 10, 2026 20:43
Comment thread index.md Outdated
Comment thread index.md Outdated
@jo-mueller jo-mueller requested a review from clbarnes June 26, 2026 09:17
Comment thread index.md Outdated
jo-mueller and others added 3 commits June 26, 2026 12:45
Co-authored-by: Benedikt Best <63287233+btbest@users.noreply.github.com>
@jo-mueller

Copy link
Copy Markdown
Contributor Author

Also, I noticed that in #117 , I introduced a constraint that would require all transformations under multiscale > coordinateTransformations to have the same directionality, i.e., "intrinsic" should be referenced by input, and the other should be the output, which is unnecessarily strict. I am removing this constraint here, which makes things easier.

cc @btbest @will-moore @clbarnes @tlambert03 @dstansby @kevinyamauchi

@btbest

btbest commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Happy with loosening the directionality, but the current MAY phrasing accidentally reintroduces the "multiscale transforms can point anywhere" problem:

  • One of input or output MUST reference the "intrinsic" coordinate system by name (path MAY be omitted or null).
  • The other MAY reference a named coordinate system in the same multiscales group (by name, path MAY be omitted or null), or in a child labels group (by name and path).
  • When referencing a child labels group, the transformation MUST be identity, scale, or translation.

The MAY in the second bullet point is the catch. Maybe I just have mischief baked in, but I immediately read this as "Well, you never told me I can't reference some other multiscale or a scene".

This should say "The other MUST reference a coordinate system either in... or in..." (the same goes for line 1328)

@jo-mueller

Copy link
Copy Markdown
Contributor Author

This should say "The other MUST reference a coordinate system either in... or in..." (the same goes for line 1328)

Right!

… is not a MAY

Co-Authored-By: Benedikt Best <63287233+btbest@users.noreply.github.com>
@jo-mueller jo-mueller force-pushed the streamline-input-output-constraints branch from b2e14de to 4880937 Compare June 29, 2026 10:07
@jo-mueller jo-mueller moved this to In review in OME-Zarr 0.6 release Jun 29, 2026
@jo-mueller jo-mueller requested a review from btbest June 30, 2026 12:03
@jo-mueller

Copy link
Copy Markdown
Contributor Author

@tlambert03 would you mind you have a quick look at this branch and see if you find the wording around the constraints around the input and output fields and where they apply clearer here? 🙂

@btbest btbest left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good as is, I just added some minor phrasing suggestions.

Remembering that any multiscales group can technically define multiple multiscales actually presents a semantic problem: the name + path referencing isn't ambiguous if the multiscales group at the path defines multiple multiscales whose intrinsic systems are identically named. I doubt this would be an issue in practice because nobody uses multiple entries in the multiscales array, but it's theoretically there.

I think to have version 0.6 being clean, we'd need the "The multiscales array MUST contain exactly one multiscale object` constraint that has been discussed before (but I think got delayed because it was bundled with flattening the multiscales-list to a single object, making it a breaking change for almost 0 gain).

Comment thread index.md Outdated
Comment thread index.md
Comment thread index.md
that refer to coordinate systems in the same zarr.json or in the metadata of multiscale image subgroups.
- One of `input` or `output` MUST reference the "intrinsic" coordinate system by `name` (`path` MAY be omitted or null).
- The other MUST reference a named coordinate system in the same multiscales group (by `name`, `path` MAY be omitted or null), or in a child [labels](#labels-md) group (by `name` and `path`).
- When referencing a child labels group, the transformation MUST be [`identity`](#identity-md), [`scale`](#scale-md), or [`translation`](#translation-md).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to check again but aren't labels required to be the same shape as the multiscale; which means this basically always has to be identity? Allowing scale and translation isn't a problem of course, just presents more opportunities for confusion I suppose.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the part where we are entering the grey zone between collections and transforms. The relationship between labels and images is first and foremost semantic in nature, not spatial. Hence 0.6 will not force you to add spatial information to your label/image connection, but if you want to, you can.

Hence, the shaping of the labels has never been written out in previous versions and 0.6 won't force this because only collections will express this relationship properly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The relationship between labels and images is first and foremost semantic in nature, not spatial

Subtle disagreement from the spec itself there:

Some applications–notably image segmentation–produce a new image that is in the same coordinate system as a corresponding multiscale image (usually having the same dimensions and coordinate transformations).

Sounds very much spatial to me :)

Just to be clear, I'm not actually asking for anything to be changed here. Just indulging.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see what you mean. The loophole here is "usually"; There was a PR where thought of changing that (possibly #117) and require this transformation to be explicit. Ultimately we decided against it:

  • If that transformation were to live in the parent multiscale image, then the addition of a child labels image would effectively invalidate the parent image because that transform would then be missing
  • If the transform were to live in /labels/segmentation_image/zarr.json, its output would have to be ../../zarr.json, which would also be problematic because moving the label image elsewhere would make it invalid and thus no longer self-describing.

The clean option would be to put the label image into a transformation graph and not use the /labels/... structure at all. Or wait for collections that will make this kind of linkage much more explicit from the point of view of an apex zarr.json in the hierarchy, which would be my preferred solution :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also don't see any point to requiring the metadata to enumerate all contents. At most I'd go to "SHOULD" level - just like the labels metadata only "SHOULD" reference all label multiscales available.

Comment thread index.md Outdated
Comment thread index.md
@jo-mueller

jo-mueller commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Remembering that any multiscales group can technically define multiple multiscales actually presents a semantic problem: the name + path referencing isn't ambiguous if the multiscales group at the path defines multiple multiscales whose intrinsic systems are identically named. I doubt this would be an issue in practice because nobody uses multiple entries in the multiscales array, but it's theoretically there.

Gulp...there's an entire RFC around this (with a complicated history, I think ^^"). Essentially, it was decided to also defer to this to collections, because collections will arrange this bit of metadata anyway. As you say, so far there haven't really been any datasets in the wild that would make use of the array structure under the multiscales field so it's something I think we can live with in the meantime.

jo-mueller and others added 4 commits July 1, 2026 12:02
Co-authored-by: Benedikt Best <63287233+btbest@users.noreply.github.com>
Co-authored-by: Benedikt Best <63287233+btbest@users.noreply.github.com>
Co-authored-by: Benedikt Best <63287233+btbest@users.noreply.github.com>
This reverts commit 96d4f2c.
@jo-mueller

Copy link
Copy Markdown
Contributor Author

Follow-up: Since we are using the term multiscale group very extensively throughout the spec I'll avoid changing this terminology too much here, but this doesn't mean that it couldn't be changed in a follow-up PR (even in an 0.6.1 version, since this is really just phrasing, not semantics).

@jo-mueller

Copy link
Copy Markdown
Contributor Author

I agree that this statement would be the cleanliest way out of that issue:

The multiscales array MUST contain exactly one multiscale object

But given the discussion around it, I think it's safer to just let it rest as it is for the moment and save the cleaning up for 1.0 😬

@joshmoore joshmoore merged commit 9801c8a into ome:main Jul 2, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in OME-Zarr 0.6 release Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

Status: Done

4 participants