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:
multiscaleLevel sets the minimum scale level that may be loaded. (Note that higher-indexed scale levels are more downsampled, and therefore lower resolution.) Loaders may still pick a higher (more downsampled) multiscale index based on the other settings below. Therefore, leaving this property at its default of 0 effectively disables enforcing a resolution level.
maxAtlasEdge modifies the maximum atlas dimension used by the loader internally when deciding which scale level is appropriate to load. When not constrained by multiscaleLevel, the loader picks the highest-resolution scale level that can be packed into a texture atlas with sides no longer than maxAtlasEdge.
scaleLevelBias allows nudging the scale level index determined based on maxAtlasEdge. E.g. if the loader determines (as described above) that level 1 is the least downsampled scale level it can load, but scaleLevelBias is 1, the loader will instead load level 2.
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:
npm start and open the viewer.
Ctrl + Alt + 1 to reveal the hidden tweakpane.
The options listed above should be present and work as described when a zarr volume is open.
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
:multiscaleLevel
sets the minimum scale level that may be loaded. (Note that higher-indexed scale levels are more downsampled, and therefore lower resolution.) Loaders may still pick a higher (more downsampled) multiscale index based on the other settings below. Therefore, leaving this property at its default of 0 effectively disables enforcing a resolution level.maxAtlasEdge
modifies the maximum atlas dimension used by the loader internally when deciding which scale level is appropriate to load. When not constrained bymultiscaleLevel
, the loader picks the highest-resolution scale level that can be packed into a texture atlas with sides no longer thanmaxAtlasEdge
.scaleLevelBias
allows nudging the scale level index determined based onmaxAtlasEdge
. E.g. if the loader determines (as described above) that level 1 is the least downsampled scale level it can load, butscaleLevelBias
is 1, the loader will instead load level 2.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 viaVolume.updateRequiredData
, which makes changes toloadSpecRequired
, then checks if the changes indicate that new data needs to be loaded. OnlymultiscaleLevel
existed in theLoadSpec
type previously. This PR adds the other two, hooks them up to theOMEZarrLoader
internals, and properly handles them inupdateRequiredData
'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:
npm start
and open the viewer.