Implements most of #78: enable OMEZarrLoader to load from multiple zarrs at once, and enable it to resolve potential mismatches in scale levels.
How this works to outside users
OMEZarrLoader.createLoader's url param is now urls, and can take either a string or a string[].
If urls is an array with more than one element, the loader loads the dimensions of every scale level in every zarr, then tries to match up each zarr's scale levels by size.
If the above step succeeds, the resulting volume behaves as if it were loaded from a single OME-Zarr with all the channels of all zarr sources in the order they were specified in urls, and all scale levels that "matched up" in all sources.
scene: number is updated to scenes: number | number[] to match, though it can be a single number when urls is an array to get the same scene index from all sources.
What I changed to make that work
Move every property of OMEZarrLoader that could differ based on zarr sources into its own type, ZarrSource, which we can put in an array.
Rework OMEZarrLoader to generate an array of ZarrSources on construction and use them in its regular methods (a large portion of the changes in this PR are just dealing with the fact that all the properties that the loader has to read are inside an array of ZarrSources now)
Add a big new function, matchSourceScaleLevels, to zarr utils that does the "matching up" described above by removing unmatched scale levels from an array of ZarrSources.
Rough review time: long (60min)
Implements most of #78: enable
OMEZarrLoader
to load from multiple zarrs at once, and enable it to resolve potential mismatches in scale levels.How this works to outside users
OMEZarrLoader.createLoader
'surl
param is nowurls
, and can take either astring
or astring[]
.urls
is an array with more than one element, the loader loads the dimensions of every scale level in every zarr, then tries to match up each zarr's scale levels by size.urls
, and all scale levels that "matched up" in all sources.scene: number
is updated toscenes: number | number[]
to match, though it can be a single number whenurls
is an array to get the same scene index from all sources.What I changed to make that work
OMEZarrLoader
that could differ based on zarr sources into its own type,ZarrSource
, which we can put in an array.OMEZarrLoader
to generate an array ofZarrSource
s on construction and use them in its regular methods (a large portion of the changes in this PR are just dealing with the fact that all the properties that the loader has to read are inside an array ofZarrSource
s now)matchSourceScaleLevels
, to zarr utils that does the "matching up" described above by removing unmatched scale levels from an array ofZarrSource
s.matchSourceScaleLevels
.