allen-cell-animated / volume-viewer

https://allen-cell-animated.github.io/volume-viewer/
Other
92 stars 7 forks source link

Handle per-source chunk dimensions when prefetching zarr #193

Closed frasercl closed 6 months ago

frasercl commented 6 months ago

Review time: moderate (~30min)

188 enabled loading into the same volume from multiple zarr sources (resolving most of #78), and included code to ensure those sources have scale levels with matching dimensions. However, its implementation has an important limitation: matching scale levels also must have matching chunk sizes. This limitation wasn't imposed due to any difficulties with fetching zarrs with different chunking strategies - zarrita will happily accept a slice into an array with any chunking strategy and work out which chunks to fetch on its own. But our prefetching implementation assumed that it could safely apply the same chunk dimensions to every channel, which is not safe when different channels may come out of different source zarrs with different chunking strategies. So this PR allows us to deal with per-channel chunk dims when prefetching, removing the need for matching chunking strategies.

Changes