Commit c800a6dbeeef9209806020c5dcde210c43d2761a

Authored by tfmoraes
1 parent 535b0d25

FIX: saving background colour in the raycasting preset plist. Related to #110

Showing 1 changed file with 7 additions and 3 deletions   Show diff stats
invesalius/data/volume.py
... ... @@ -100,13 +100,13 @@ class Volume():
100 100 ps.Publisher().subscribe(self.OnEnableTool,
101 101 'Enable raycasting tool')
102 102 ps.Publisher().subscribe(self.OnCloseProject, 'Close project data')
  103 + ps.Publisher().subscribe(self.ChangeBackgroundColour,
  104 + 'Change volume viewer background colour')
103 105  
104 106 def OnCloseProject(self, pubsub_evt):
105 107 self.CloseProject()
106 108  
107   -
108 109 def CloseProject(self):
109   -
110 110 if self.plane:
111 111 self.plane = None
112 112 ps.Publisher().sendMessage('Remove surface actor from viewer', self.plane_actor)
... ... @@ -114,7 +114,6 @@ class Volume():
114 114 self.exist = None
115 115 ps.Publisher().sendMessage('Remove surface actor from viewer', self.volume)
116 116  
117   -
118 117 def OnLoadVolume(self, pubsub_evt):
119 118 label = pubsub_evt.data
120 119 #self.LoadConfig(label)
... ... @@ -369,6 +368,11 @@ class Volume():
369 368 self.config['backgroundColorBlueComponent'])
370 369 return colour
371 370  
  371 + def ChangeBackgroundColour(self, pubsub_evt):
  372 + self.config['backgroundColorRedComponent'] = pubsub_evt.data[0] * 255
  373 + self.config['backgroundColorGreenComponent'] = pubsub_evt.data[1] * 255
  374 + self.config['backgroundColorBlueComponent'] = pubsub_evt.data[2] * 255
  375 +
372 376 def BuildTable():
373 377 curve_table = p['16bitClutCurves']
374 378 color_background = (p['backgroundColorRedComponent'],
... ...