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.
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 methodsetChannelOptions
, which works similarly to theupdateSettings
method added toVolumeRenderImpl
s 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 callingsetChannelOptions
rather thansetVolumeChannelEnabled
from the outerView3D
method, but we ought to circle back and treat the root cause.