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