@@ -846,19 +846,6 @@ class NiiVue(BaseAnyWidget):
846846 other_nv = t .List (t .Instance (object , allow_none = False ), default_value = []).tag (
847847 sync = False
848848 )
849- sync_opts = t .Dict (
850- default_value = {
851- "3d" : False ,
852- "2d" : False ,
853- "zoom_pan" : False ,
854- "cal_min" : False ,
855- "cal_max" : False ,
856- "clip_plane" : False ,
857- "gamma" : False ,
858- "slice_type" : False ,
859- "crosshair" : False ,
860- }
861- ).tag (sync = False )
862849
863850 @t .validate ("other_nv" )
864851 def _validate_other_nv (self , proposal ):
@@ -876,28 +863,6 @@ def _validate_other_nv(self, proposal):
876863 )
877864 return value
878865
879- @t .validate ("sync_opts" )
880- def _validate_sync_opts (self , proposal ):
881- ALLOWED_KEYS = {
882- "3d" ,
883- "2d" ,
884- "zoom_pan" ,
885- "cal_min" ,
886- "cal_max" ,
887- "clip_plane" ,
888- "gamma" ,
889- "slice_type" ,
890- "crosshair" ,
891- }
892- value = proposal ["value" ]
893- invalid_keys = set (value .keys ()) - ALLOWED_KEYS
894- if invalid_keys :
895- raise t .TraitError (
896- f"Invalid keys in sync_opts: { invalid_keys } . "
897- f"Allowed keys: { ALLOWED_KEYS } "
898- )
899- return value
900-
901866 def __init__ (self , height : int = 300 , ** options ): # noqa: D417
902867 r"""
903868 Initialize the NiiVue widget.
@@ -918,11 +883,22 @@ def __init__(self, height: int = 300, **options): # noqa: D417
918883 super ().__init__ (height = height , opts = opts , volumes = [], meshes = [])
919884
920885 # Initialize values
886+ self .this_model_id = self ._model_id
921887 self ._cluts = self ._get_initial_colormaps ()
922888 self .graph = Graph (parent = self )
923889 self .scene = Scene (parent = self )
924890 self .other_nv = []
925- self .this_model_id = self ._model_id
891+ self .sync_opts = {
892+ "3d" : False ,
893+ "2d" : False ,
894+ "zoom_pan" : False ,
895+ "cal_min" : False ,
896+ "cal_max" : False ,
897+ "clip_plane" : False ,
898+ "gamma" : False ,
899+ "slice_type" : False ,
900+ "crosshair" : False ,
901+ }
926902
927903 # Handle messages coming from frontend
928904 self ._event_handlers = {}
0 commit comments