Skip to content

Displacements are multiscales#145

Open
jo-mueller wants to merge 14 commits into
ome:mainfrom
jo-mueller:displacements-are-multiscales
Open

Displacements are multiscales#145
jo-mueller wants to merge 14 commits into
ome:mainfrom
jo-mueller:displacements-are-multiscales

Conversation

@jo-mueller

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

Copy link
Copy Markdown
Contributor

Fixes ome/ngff#520

This changes how displacement fields and coordinate arrays are expected to be stored in displacement/coordinate transforms, as discussed in the 06/2026 Hackathon at EMBL.

The gist: The arrays are now simply multiscale groups and the displacement/coordinate dimension should go into the channel dimension of the data.

  • updated the spec text
  • updated the examples (removed the 1d examples because 1d is not allowed anyway)
  • no change to the schema
  • updated version history

@bogovicj @clbarnes @melonora @LucaMarconato @thewtex @tischi @kevinyamauchi @jni @DragaDoncila @perlman
...who am I forgetting?

@jo-mueller jo-mueller added the enhancement New feature or request label Jun 12, 2026
@github-actions

Copy link
Copy Markdown

Automated Review URLs

@jo-mueller

Copy link
Copy Markdown
Contributor Author

Maybe should add a recommendation/statement about which resolution level of the displacement field implementations should use?

If multiple resolution levels are provided, implementations MAY choose any resolution level to compute the output.

Also, do we need to add constraints/hints on possible pathologies that can arise when downsampling vector fields/coordinate lists?

@thewtex thewtex 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.

🥇 😍 🚀

@thewtex

thewtex commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Maybe should add a recommendation/statement about which resolution level of the displacement field implementations should use?

If multiple resolution levels are provided, implementations MAY choose any resolution level to compute the output.

👍

And possibly SHOULD use the finest resolution if the result is used beyond quick visualization purposes.

Also, do we need to add constraints/hints on possible pathologies that can arise when downsampling vector fields/coordinate lists?

We could also recommend that anti-alias filtering SHOULD be applied when downsampling, similar to an intensity image multiscale.

@imagesc-bot

Copy link
Copy Markdown

This pull request has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/serialise-displacement-field-as-ome-zarr/121117/6

Comment thread index.md Outdated
@jo-mueller jo-mueller requested a review from clbarnes June 22, 2026 13:54
@jo-mueller

Copy link
Copy Markdown
Contributor Author

@bogovicj @clbarnes @melonora @LucaMarconato @thewtex @tischi @kevinyamauchi @jni @DragaDoncila @perlman @d-v-b last call - any more feedback on this?

@LucaMarconato

LucaMarconato commented Jun 22, 2026

Copy link
Copy Markdown

One comment not in the diff of this PR:

  • If nearest interpolation is used for a coordinates transformation,
    the transformed image collapses into a single point at the nearest coordinate in the coordinate field.
  • If nearest interpolation is used for a displacements transformation,
    the transformed image is piecewise constant with discontinuities at the boundaries between nearest neighbor regions.

I haven't worked with this yet so I may be missing something, but aren't the two representations (coordinate and displacements) equivalent? Why do we have 2 different "if"? Shouldn't be the implication the same?

EDIT: ah I see below that "displacements require M=N." so they are not equivalent and now I got what the 2 "if" mean: with displacement the shift is constant for all the neighbors of a point in the domain grid, while for coordinates the target image is constant for each point of the domain grid.

So the text it's correct, but it can be confusing if someone is new with the concept because the definition of how displacement and coordinates operates as a function is missing. The specs start right away in showing how to represent them, but not how they would behave as functions.

Comment thread index.md
Comment thread index.md
Comment thread index.md
Comment thread index.md Outdated
Comment thread index.md
@LucaMarconato

Copy link
Copy Markdown

Thanks @jo-mueller for opening this! My comments are most about the text that is not touched by this PR, but that I reviewed together with the changes. I think the changes are mostly ok (and with the new usage of multiscales the text is shorter and clearer).

@jo-mueller

Copy link
Copy Markdown
Contributor Author

@LucaMarconato thanks for the review! I expanded the example below the hint box a bit to make the procedure more clear on how the retrieved, interpolated vector is obtained from a given input point x in physical coordinates.

I'm considering the hint box entirely since the example is maybe more informative anyway. Let me know if that clears things up!

Comment thread index.md
Comment thread index.md
Comment thread version_history.md Outdated
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

Development

Successfully merging this pull request may close these issues.

RFC-5: relocate coordinates/displacements index transformations

9 participants