Skip to content

feat: add support for input/output in ome transforms as object - #1100

Open
seankmartin wants to merge 4 commits into
google:masterfrom
MetaCell:feat/update-ome-zarr-06-transform-input-output
Open

feat: add support for input/output in ome transforms as object#1100
seankmartin wants to merge 4 commits into
google:masterfrom
MetaCell:feat/update-ome-zarr-06-transform-input-output

Conversation

@seankmartin

@seankmartin seankmartin commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Previously from the transforms RFC the input/output field of a transform was a string, where the string could be the name or the path and based on the location of the transform the appropriate meaning was inferred. This has changed in the ome spec so that the input/output is an object with name and path as optional strings. Generally speaking only one of name and path is intended to be filled for each input/output. For example, the path is expected to be filled on the input while name is expected to be filled on the output of transforms inside of multiscales.datasets. This PR is to update support in neuroglancer for that.

We continue to allow strings because we support version 0.6.dev1 which was built to the old spec. If there is a string input or output, we interpret that as an object with name and path both filled in to the value of the provided string. Because of this we also remain slightly looser than some of the MUST clauses in the spec around input and output, because of how we implemented the initial support. In summary this leaves us compliant when provided valid metadata, and we do verify a lot of the key metadata for correctness, but we don't enforce compliance with some MUST clauses for every part of the spec.

In addition it also adds a new way of finding the intrinsic coordinate space and output coordinate space. Since the ome spec now includes a way to determine the intrinsic space as the space that is named as the output of each transform in the multiscales.datasets, we can iterate the names to verify all have the same output name - and if so, use that as the intrinsic space.

We don't follow the recommendation from the spec (not a MUST) that suggests viewers to use the intrinsic space unless instructed otherwise. Since we don't have a coordinateSpace selector, we follow the existing code in neuroglancer which applies the multiscales.coordinateTransforms, if present, in order. So our output coordinateSpace is the intrinsic space if multiscales.coordinateTransforms is not present. Otherwise it is the coordinateSpace which has the same name as the output from the last transform in multiscales.coordinateTransforms - which may be the intrinsic space still.

Previously from RFC it was a string, where the string could be the name or the path and
based on the location of the transform the appropriate meaning was inferred. This has
changed in the ome spec and this commit is to update that in neuroglancer's support.

In addition it also adds a new way of finding the intrinsic coordinate space. Since the
ome spec now includes a way to determine the intrinsic space as the space that is named
as the output of each transform in the multiscales, we can iterate the names to verify
all have the same output name - and if so, use that as the intrinsic space. Since the
spec recommends viewers use this space unless instructed otherwise, neuroglancer can now
use this space instead of assuming the last coordinate space listed is the intrinsic
one.
@chrisj

chrisj commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

can you add a test to ome.spec.ts for this?

If multiscales.coordinateTransformations is present, then our final coordinateSystem is
the output of the final transform in the array of transforms. If only
multiscales.datasets is present, then instead it is the intrinsic coordinateSpace,
inferred from the names of the output of the transforms (which must be the same at each
scale)
@seankmartin

Copy link
Copy Markdown
Contributor Author

can you add a test to ome.spec.ts for this?

Yes I added a test and updated a few others to better reflect the status of the transforms spec

@seankmartin
seankmartin marked this pull request as ready for review August 27, 2026 13:10
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.

2 participants