allen-cell-animated / volume-viewer

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

Multiresolution loading options in tweakpane #195

Closed frasercl closed 6 months ago

frasercl commented 6 months ago

Review time: pretty quick (15min)

Resolves #184: exposes settings for picking which multiscale level to load via tweakpane.

The hidden tweakpane now contains the following options, under a folder labeled Multiscale loading:

Internally, tweakpane modifies properties with the same names on Volume.loadSpecRequired, which represents the data requested for display based on current settings. It does this via Volume.updateRequiredData, which makes changes to loadSpecRequired, then checks if the changes indicate that new data needs to be loaded. Only multiscaleLevel existed in the LoadSpec type previously. This PR adds the other two, hooks them up to the OMEZarrLoader internals, and properly handles them in updateRequiredData's reload check.

While I was testing, I found a bug that was causing the loader to unconditionally pick the highest available scale level in Z-slice mode, regardless of the value of maxAtlasEdge. So I fixed that too. This accounts for the changes to Atlas2DSlice.ts and VolumeDrawable.ts.

Steps to test: