Commit faa6c3259f76635289c45ea0b59207dbce972448

Authored by Paulo Henrique Junqueira Amorim
1 parent a1e6c2e2

FIX: Start to return function and Window Level.

invesalius/data/slice_.py
@@ -586,8 +586,12 @@ class Slice(object): @@ -586,8 +586,12 @@ class Slice(object):
586 return img_colours_bg.GetOutput() 586 return img_colours_bg.GetOutput()
587 587
588 def UpdateWindowLevelBackground(self, pubsub_evt): 588 def UpdateWindowLevelBackground(self, pubsub_evt):
589 - pass  
590 - #window, level = pubsub_evt.data 589 +
  590 + window, level = pubsub_evt.data
  591 + self.window_width = window
  592 + self.window_level = level
  593 + ps.Publisher().sendMessage('Reload actual slice')
  594 + ps.Publisher().sendMessage('Update slice viewer')
591 #window_level = self.window_level 595 #window_level = self.window_level
592 596
593 #if not((window == window_level.GetWindow()) and\ 597 #if not((window == window_level.GetWindow()) and\
invesalius/data/viewer_slice.py
@@ -358,7 +358,7 @@ class Viewer(wx.Panel): @@ -358,7 +358,7 @@ class Viewer(wx.Panel):
358 window, level = pubsub_evt.data 358 window, level = pubsub_evt.data
359 self.acum_achange_window, self.acum_achange_level = (window, level) 359 self.acum_achange_window, self.acum_achange_level = (window, level)
360 self.SetWLText(window, level) 360 self.SetWLText(window, level)
361 - 361 +
362 362
363 def OnChangeSliceMove(self, evt, obj): 363 def OnChangeSliceMove(self, evt, obj):
364 if (self.left_pressed): 364 if (self.left_pressed):
@@ -443,9 +443,7 @@ class Viewer(wx.Panel): @@ -443,9 +443,7 @@ class Viewer(wx.Panel):
443 # Window & Level text 443 # Window & Level text
444 self.wl_text = vtku.Text() 444 self.wl_text = vtku.Text()
445 self.SetWLText(proj.level, proj.window) 445 self.SetWLText(proj.level, proj.window)
446 -  
447 -  
448 - # Orientation text 446 + # Orientation texea
449 if self.orientation == 'AXIAL': 447 if self.orientation == 'AXIAL':
450 values = [_('R'), _('L'), _('A'), _('P')] 448 values = [_('R'), _('L'), _('A'), _('P')]
451 elif self.orientation == 'SAGITAL': 449 elif self.orientation == 'SAGITAL':
@@ -1094,9 +1092,9 @@ class Viewer(wx.Panel): @@ -1094,9 +1092,9 @@ class Viewer(wx.Panel):
1094 #actor_bound = actor.GetBounds() 1092 #actor_bound = actor.GetBounds()
1095 self.interactor.Render() 1093 self.interactor.Render()
1096 1094
1097 - #self.EnableText() 1095 + self.EnableText()
1098 ## Insert cursor 1096 ## Insert cursor
1099 - #self.SetInteractorStyle(const.STATE_DEFAULT) 1097 + self.SetInteractorStyle(const.STATE_DEFAULT)
1100 1098
1101 #self.__build_cross_lines() 1099 #self.__build_cross_lines()
1102 1100