Skip to content

Unify input output#117

Open
jo-mueller wants to merge 14 commits intoome:mainfrom
jo-mueller:unify-input-output
Open

Unify input output#117
jo-mueller wants to merge 14 commits intoome:mainfrom
jo-mueller:unify-input-output

Conversation

@jo-mueller
Copy link
Copy Markdown
Contributor

@jo-mueller jo-mueller commented Mar 26, 2026

Fixes ome/ngff#480
Fixes ome/ngff#437
Relevant for ome/ngff#360

Description

In previous versions of the spec, we had used a mix of contentions when it came to specifying the inputs and outputs of coordinate transformations:

  • In the scene context, input and output had to be an object with fields name and path.
  • For the multiscale transformations inside the multiscales metadata (multiscales > datasets > coordinateTransformations), only a string was allowed, which had to correspond to the path of the respective dataset entry.
  • For the additional transforms next to the multiscales metadata (multiscales > coordinateTransformations), a string was required, which had to correspond top the name of a coordinate system in the same metadata document.

Following the original suggestion of @dstansby at ome/ngff#437, this is unified into a common syntax in this PR. It also has adjustments for schemas, examples and CI tests.

cc @will-moore @dstansby @clbarnes @bogovicj

@jo-mueller jo-mueller added the enhancement New feature or request label Mar 26, 2026
@github-actions
Copy link
Copy Markdown

Automated Review URLs

@jo-mueller jo-mueller marked this pull request as ready for review March 26, 2026 16:31
@jo-mueller jo-mueller changed the title WIP: Unify input output Unify input output Mar 26, 2026
Copy link
Copy Markdown
Contributor

@dstansby dstansby left a comment

Choose a reason for hiding this comment

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

Some comments, but 👍 this looks great overall

See the [example below](spec:example:coordinate_transformation).

```{hint}
[Multiscale images](#multiscale-md) generally have an "intrinsic" coordinate system,
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.

Could "generally" be changed to either "are recommended to" or "always", to make it clearer whether they're always present, and if not recommended?


```{hint}
[Multiscale images](#multiscale-md) generally have an "intrinsic" coordinate system,
which will generally be a representation of the image in its native physical coordinate system.
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.

What does "generally be a..." mean here? That it's an innacurate represenatation? That sometimes it isn't a represenation in a physical coordinate system?

As a general thought I think it's more confusing to have general statements like this in the spec that are not true for all datasets.

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.

The statement here was intended to introduce the term "intrinsic" up front, because it's used several times further down. I guess there are cases where the described image array (i.e., the "intrinsic" coordinate system) is different from the coordinate system in which one would want to natively view the image. For instance, in SCAPE microscopy, the acquired image stack is skewed, so the native stack is not something one would prefer to look at. But that's relatively niche and for 99% of all use cases, the statement probably holds.

The values of `input` and `output` MUST be an object with the fields `name` and `path` that satisfy:
- The `path` field of `input` MUST be the same as the `path` field of the dataset,
the `name` field of `input` can be omitted.
Implementations should always treat the value of `path` under the `input` field as if it were equal to the value of `path`.
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 don't understand the "path must be equal to path" constraint here? Possibly this is a hangover from the previous version and can just be deleted now?

Copy link
Copy Markdown
Contributor Author

@jo-mueller jo-mueller Mar 27, 2026

Choose a reason for hiding this comment

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

Yeah...it sounded clunky no matter how I put it.

Essentially, a dataset entry must contain

{
  "path": "s0",
  "coordinateTransformations": [
    {
      "type": "indentity",
      "input": {"path": "s0"},
      "output": {"name": "physical"}
    }
  ]
}

and I wanted to express that the contents of both path fields in here must be identical.

The `path` field of `output` can be omitted.

The coordinate system referenced by all `output` fields of the coordinate transformations (the "intrinsic" coordinate system)
will generally be a representation of the image in its native physical coordinate system.
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.

Again, what does "generally" mean?

index.md Outdated
which is different from the "intrinsic" coordinate system.
The values of both `input` and `output` fields MUST be an object with fields `name` and `path`.
The value of `input` MUST be the "intrinsic" coordinate system.
The value of `output` can be the name of an output coordinate System in the same multiscales group
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.

Suggested change
The value of `output` can be the name of an output coordinate System in the same multiscales group
The value of `output` can be the name of an output coordinate system in the same multiscales group

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.

Also, this currently implies value of output can be a string, is that correct?

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.

Ah, good point. I edited the section a bit in 9c7dae2

jo-mueller and others added 6 commits March 27, 2026 17:26
Co-authored-by: David Stansby <dstansby@gmail.com>
Co-authored-by: David Stansby <dstansby@gmail.com>
Co-authored-by: David Stansby <dstansby@gmail.com>
Co-authored-by: David Stansby <dstansby@gmail.com>
Co-authored-by: David Stansby <dstansby@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

2 participants