Skip to content

Include translations in multiscales - #590

Merged
jo-mueller merged 4 commits into
ome:masterfrom
will-moore:include_translations_in_multiscales
Jun 17, 2026
Merged

Include translations in multiscales#590
jo-mueller merged 4 commits into
ome:masterfrom
will-moore:include_translations_in_multiscales

Conversation

@will-moore

Copy link
Copy Markdown
Member

Fixes #403.

This is on top of #515. Can rebase once that's merged.

Encouraged by discussion at ome/ngff#89 (comment), this adds translation to the dataset coordinateTransformsations generated on downsampling.

Need to add/update tests...

cc @jo-mueller

@almarklein

almarklein commented Jun 10, 2026

Copy link
Copy Markdown

BTW, with the 'nearest' downsample method, I imagine it basically does a[::2] for all dimensions; the new samples are exactly on top of the samples in the previous layer. This gives the following scheme, and the offsets should be zero:

             _______ _______ _______ _______
            |___o___|___o___|___o___|___o___|   level 0
         _______________ _______________ ___
        |_______o_______|_______o_______|___    level 1
 _______________________________ ___________
|_______________o_______________|___________    level 2

Edit: nevermind, with nearest it does not matter which of the two pixels is taken, so in this case the offset can be either, I guess. That said, if you first smooth the data and then sample it with a[::2] the above schema does apply, because you've moved information from the neighbours to the sampled pixels.

Comment thread ome_zarr/classes/image.py
Comment thread tests/test_writer.py Outdated
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.67%. Comparing base (de247e5) to head (db3d40e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #590      +/-   ##
==========================================
+ Coverage   86.65%   86.67%   +0.01%     
==========================================
  Files          16       16              
  Lines        2316     2319       +3     
==========================================
+ Hits         2007     2010       +3     
  Misses        309      309              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@will-moore

Copy link
Copy Markdown
Member Author

@jo-mueller - rebased and fixed tests

@jo-mueller
jo-mueller merged commit 9a96549 into ome:master Jun 17, 2026
14 checks passed
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.

coordinateTransformations generated for 0.4 are scale-only

3 participants