Clarify how channel state is updated
Closed this issue · 1 comments
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 VolumeRenderImpl
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 calling setChannelOptions
rather than setVolumeChannelEnabled
from the outer View3D
method, but we ought to circle back and treat the root cause.