allen-cell-animated / volume-viewer

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

Fix flashing during Z slice playback #183

Closed frasercl closed 7 months ago

frasercl commented 7 months ago

Problem

Currently, when playing through Z slices in website-3d-cell-viewer, if the next slice is across a chunk boundary (which it always is with our new chunking), the current slice disappears before the next one loads, creating a flashing effect. This happens because the viewer immediately moves to the next unloaded z slice, rather than lingering on the current one until the next is available.

Solution

I spun my wheels on this for a sec, thinking I'd have to mess with how/when a Volume's ImageInfo is updated on new loads. Turns out the trouble was just with the slice setting in Atlas2DSlice. Now, if an update to zSlice would move the viewed slice into an unloaded region, that update is instead deferred until a volume dimension update indicates that the region is loaded.