-
Notifications
You must be signed in to change notification settings - Fork 81
New lazy to_multiscale() for labels #1068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi @LucaMarconato , PR ome/ome-zarr-py#516 also addresses the issues with the downscaling in z (now built in for all methods) 👍 |
|
That's perfect! Then I'll use that PR instead. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1068 +/- ##
==========================================
+ Coverage 91.89% 91.93% +0.04%
==========================================
Files 49 51 +2
Lines 7598 7664 +66
==========================================
+ Hits 6982 7046 +64
- Misses 616 618 +2
🚀 New features to boost your workflow:
|
|
The PR is ready. I'll merge and test it with downstream libraries, as it will provide a significant performance boost that I want to make available soon. Additionally, I've created an issue (#1070) to align the code with the z-support from ome-zarr-py once the corresponding PR is merged (ome/ome-zarr-py#516). |




Closes #1069
This PR (still work-in-progress) aims at implementing a function to generate a pyramidal image given a dask array, by relying on
ome-zarrinternal APIs and by extending functionalities currently not available viaome_zarr.scale.Scaler. Such a function is also provided by themultiscale-spatial-imagepackage, but as explained in the linked issue we hit a performance roadblock.ome-zarr-pydoes not support downscaling of thezdimension, nor downscaling via scale factors specified per dimension (both cases are supported bymultiscale-spatial-image); these cases will be covered by this PR. The implementation could also live inome-zarr-py(CC @will-moore @joshmoore @jo-mueller), I'd be happy if someone later can pick up the code so I can remove it fromspatialdataand use it from upstream.Side technical note:
spatialdatausesxarray_coarsen(frommultiscale-spatial-image) for images, (which is fully lazy), anditk_nearest(frommultiscale-spatial-image) for labels (which is not lazy and therefore problematic). Since downscaling for images doesn't give problems, we could use the old implementation, but I'm reimplementing it withome-zarr-pyAPIs anyway. So far it seems that both implementations lead to identical results when the scale factors are all 2.