allen-cell-animated / volume-viewer

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

Clarify how channel state is updated #160

Closed frasercl closed 10 months ago

frasercl commented 10 months ago

Description

VolumeDrawable currently provides two means to update the state of a channel. One is via bespoke per-property methods (setVolumeChannelEnabled, updateChannelColor, etc.). The other is through the single method setChannelOptions, which works similarly to the updateSettings method added to VolumeRenderImpls by #124: it manages a settings object, and handles merging in new fragments of that object and updating state.

The existence of both ways to update settings means that the channel settings object is inconsistently used, with occasionally unpredictable results. In particular, this caused an issue with channel enabled/disabled state being inconsistent across loads (incl. on time or z-slice changes) because channel state was restored on reload from this object, but explicitly calling setVolumeChannelEnabled never updated the object. #153 fixes this by calling setChannelOptions rather than setVolumeChannelEnabled from the outer View3D method, but we ought to circle back and treat the root cause.

frasercl commented 10 months ago

Closed as duplicate of #159