Skip to content

feat: support multiscales#22

Merged
m-albert merged 17 commits into
multiview-stitcher:mainfrom
jo-mueller:support-multiscales
Jul 21, 2026
Merged

feat: support multiscales#22
m-albert merged 17 commits into
multiview-stitcher:mainfrom
jo-mueller:support-multiscales

Conversation

@jo-mueller

Copy link
Copy Markdown
Contributor

Hi @m-albert ,

small QOL feature to enable working with multiscales in napari that are not xarray multiscales. This makes the napari-multiview stitcher compatible with ome-zarr 0.6-backed scenes. In anapri, you can then just drag&drop an entire scene along with the coordinates of each tile, hit fuse or register and you're done :)

multiview_stitcher_example.mp4

@m-albert

Copy link
Copy Markdown
Collaborator

Hey @jo-mueller, this is super cool 😍😎🚀

Will have a look at the code tomorrow!

@m-albert

Copy link
Copy Markdown
Collaborator

Perfect, so with the changes you made the stitching plugin gets multiscale xarray images from multiscale napari layers 🥳🥳

That will allow the plugin to use the right resolution layer from the napari layer for registration. For fusion, napari-stitcher is a bit behind multiview-stitcher and still fuses individual resolution layers.

If you don't mind I'll hijack your PR branch and add changes to complete full multiscales support.

@jo-mueller

Copy link
Copy Markdown
Contributor Author

If you don't mind I'll hijack your PR branch and add changes to complete full multiscales support

Not at all :) Actually maybe you could also hijack the resolution level selector in the latest napari version? I.e., you could set the resolution on a per layer basis and then use that as an indicator on which level to use? 🤔

@m-albert

Copy link
Copy Markdown
Collaborator

I like the idea! The closer the control is to vanilla / built-in napari the better :)

How about the following: If the resolution is set to a given resolution for a given layer, that's used within the stitcher. If it's left on Auto, the stitcher chooses the resolution.

@m-albert

Copy link
Copy Markdown
Collaborator

Okay, I

  • adapted the code to use new multiview-stitcher multiscale features
  • added the possibility for the user to choose whether fusion is computed on the fly or pre-computed to OME-Zarr
  • made registration use the scale chosen by the user in the napari interface as per your suggestion @jo-mueller :)

I also added a multiscale sample dataset which illustrates the multiscale behaviour :)

multiscale_digits.mp4

@jo-mueller

Copy link
Copy Markdown
Contributor Author

Woah awesomeI! Love the numbering in the scale levels, very cool idea 💪

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.48193% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.75%. Comparing base (f9f950e) to head (7cf06b4).
⚠️ Report is 10 commits behind head on main.

⚠️ Current head 7cf06b4 differs from pull request most recent head 52a5358

Please upload reports for the commit 52a5358 to get more accurate results.

Files with missing lines Patch % Lines
src/napari_stitcher/_stitcher_widget.py 88.00% 12 Missing ⚠️
src/napari_stitcher/viewer_utils.py 92.30% 2 Missing ⚠️
src/napari_stitcher/_mosaic_widget.py 96.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #22      +/-   ##
==========================================
+ Coverage   86.24%   88.75%   +2.51%     
==========================================
  Files          13       14       +1     
  Lines         858     1290     +432     
==========================================
+ Hits          740     1145     +405     
- Misses        118      145      +27     

☔ 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.

@jo-mueller

Copy link
Copy Markdown
Contributor Author

Following this, it would probably be really cool to have a writer in napari so one could then save the stitched output into ome-zarr 🤔

@m-albert

Copy link
Copy Markdown
Collaborator

Definitely! Maybe napari-ome-zarr would be a good place for this, or maybe even already has a writer?

Next to the stitched image it'd be cool to be able to save the refined transformation parameters (without writing image data) to individual multiscales, or an OME-Zarr v06 scene.

@jo-mueller

Copy link
Copy Markdown
Contributor Author

Napari-ome-zarr would be the right place, but can't do it yet 👍

@m-albert

Copy link
Copy Markdown
Collaborator

I see, do you know why it is that it cannot do it yet? Is it simply that it's not implemented yet or are there blockers?

@jo-mueller

jo-mueller commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Totally in scope! I think since the more recent API changes at ome-zarr-py, it should be relatively straightforward. Project for Thursday?

Edit: ome/napari-ome-zarr#163

@m-albert

Copy link
Copy Markdown
Collaborator

Sounds great :)

@m-albert

Copy link
Copy Markdown
Collaborator

Merging here! Thanks for kicking this off @jo-mueller :)

@m-albert
m-albert merged commit 25c7a04 into multiview-stitcher:main Jul 21, 2026
7 checks passed
@jo-mueller
jo-mueller deleted the support-multiscales branch July 21, 2026 14:22
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