Commit f2fcafb052439de8a79a00c6e3a8b54b1da4dc9a

Authored by tatiana
1 parent e69343f2

ENH: Editor working without cross - pending fixme on viewer_slice

invesalius/data/slice_.py
@@ -27,6 +27,7 @@ class Slice(object): @@ -27,6 +27,7 @@ class Slice(object):
27 'Update cursor position in slice') 27 'Update cursor position in slice')
28 ps.Publisher().subscribe(self.UpdateCursorPositionSingleAxis, 28 ps.Publisher().subscribe(self.UpdateCursorPositionSingleAxis,
29 'Update cursor single position in slice') 29 'Update cursor single position in slice')
  30 +
30 # General slice control 31 # General slice control
31 ps.Publisher().subscribe(self.CreateSurfaceFromIndex, 32 ps.Publisher().subscribe(self.CreateSurfaceFromIndex,
32 'Create surface from index') 33 'Create surface from index')
@@ -55,10 +56,7 @@ class Slice(object): @@ -55,10 +56,7 @@ class Slice(object):
55 def __get_mask_data_for_surface_creation(self, pubsub_evt): 56 def __get_mask_data_for_surface_creation(self, pubsub_evt):
56 mask_index = pubsub_evt.data 57 mask_index = pubsub_evt.data
57 CreateSurfaceFromIndex 58 CreateSurfaceFromIndex
58 -  
59 -  
60 -  
61 - 59 +
62 def __add_mask(self, pubsub_evt): 60 def __add_mask(self, pubsub_evt):
63 mask_name = pubsub_evt.data 61 mask_name = pubsub_evt.data
64 self.CreateMask(name=mask_name) 62 self.CreateMask(name=mask_name)
@@ -280,6 +278,8 @@ class Slice(object): @@ -280,6 +278,8 @@ class Slice(object):
280 278
281 def GetOutput(self): 279 def GetOutput(self):
282 return self.cast_filter.GetOutput() 280 return self.cast_filter.GetOutput()
  281 +
  282 +
283 283
284 def SetInput(self, imagedata): 284 def SetInput(self, imagedata):
285 self.imagedata = imagedata 285 self.imagedata = imagedata
@@ -338,7 +338,6 @@ class Slice(object): @@ -338,7 +338,6 @@ class Slice(object):
338 self.cast_filter.Update() 338 self.cast_filter.Update()
339 ps.Publisher().sendMessage('Update slice viewer') 339 ps.Publisher().sendMessage('Update slice viewer')
340 340
341 -  
342 def UpdateCursorPositionSingleAxis(self, pubsub_evt): 341 def UpdateCursorPositionSingleAxis(self, pubsub_evt):
343 axis_pos = pubsub_evt.data 342 axis_pos = pubsub_evt.data
344 x, y, z = self.cross.GetCursorPosition() 343 x, y, z = self.cross.GetCursorPosition()
invesalius/data/viewer_slice.py
@@ -36,7 +36,7 @@ class Viewer(wx.Panel): @@ -36,7 +36,7 @@ class Viewer(wx.Panel):
36 self.SetBackgroundColour(colour) 36 self.SetBackgroundColour(colour)
37 37
38 # Interactor aditional style 38 # Interactor aditional style
39 - self.modes = ['DEFAULT'] 39 + self.modes = []#['DEFAULT']
40 self.mouse_pressed = 0 40 self.mouse_pressed = 0
41 41
42 self.__init_gui() 42 self.__init_gui()
@@ -195,8 +195,10 @@ class Viewer(wx.Panel): @@ -195,8 +195,10 @@ class Viewer(wx.Panel):
195 for coord in pixels: 195 for coord in pixels:
196 ps.Publisher().sendMessage(evt_msg, coord) 196 ps.Publisher().sendMessage(evt_msg, coord)
197 197
198 - self.OnCrossMove(None, None)  
199 - 198 + # FIXME: This is idiot, but is the only way that brush operations are
  199 + # working when cross is disabled
  200 + ps.Publisher().sendMessage('Update slice viewer')
  201 + ps.Publisher().sendMessage('Update slice viewer')
200 202
201 def OnBrushMove(self, obj, evt_vtk): 203 def OnBrushMove(self, obj, evt_vtk):
202 coord = self.GetCoordinateCursor() 204 coord = self.GetCoordinateCursor()
@@ -216,6 +218,8 @@ class Viewer(wx.Panel): @@ -216,6 +218,8 @@ class Viewer(wx.Panel):
216 for coord in pixels: 218 for coord in pixels:
217 ps.Publisher().sendMessage(evt_msg, coord) 219 ps.Publisher().sendMessage(evt_msg, coord)
218 self.interactor.Render() 220 self.interactor.Render()
  221 + ps.Publisher().sendMessage('Update slice viewer')
  222 +
219 223
220 def OnCrossMove(self, obj, evt_vtk): 224 def OnCrossMove(self, obj, evt_vtk):
221 coord = self.GetCoordinate() 225 coord = self.GetCoordinate()