allen-cell-animated / volume-viewer

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

Rework `LoadSpec` #146

Closed frasercl closed 11 months ago

frasercl commented 11 months ago

Fully resolves #134: reworks LoadSpec to have all the fields we want and none of the fields we don't.

Also, updated loaders to always set Volume.loadSpec to reflect the data that was actually loaded, rather than the LoadSpec that was passed in. E.g. no loader other than zarr can use subregion, so keep it set to the max. And since json loader has to load channels in static groups of (up to) four, when the user requests some subset of channels, also include all the channels that came along with the requested channel's images.

frasercl commented 11 months ago

Could you talk a bit more about why subpath was removed?

As I understand it, the only thing subpath might have been used for is what multiscaleLevel does now: picking different multiscale levels, by name rather than index (if they were different - I think that was rare anyways). It was never really used anywhere and didn't have a clear reason to keep existing. @toloudis might know more though.

toloudis commented 11 months ago

Could you talk a bit more about why subpath was removed?

As I understand it, the only thing subpath might have been used for is what multiscaleLevel does now: picking different multiscale levels, by name rather than index (if they were different - I think that was rare anyways). It was never really used anywhere and didn't have a clear reason to keep existing. @toloudis might know more though.

Yes - in zarr metadata, a multiscale level is really pointing to a folder that contains zarr arrays. And in practice, often the folder name is the same as the integer index. So subpath (aka multiscale level as string) was an early way to make it work but it's only relevant for Zarr. An integer level index is much more sensible and general - and in the Zarr case, it is used to find the subpath to the zarr data for that level.