Commit b7d73f1ce003f8e9c43fb0abfe09589583598b39

Authored by tatiana
1 parent eaf2b14b

ENC: Cross behaviour equal to comercial software

invesalius/data/slice_.py
... ... @@ -25,6 +25,8 @@ class Slice(object):
25 25 # Slice properties
26 26 ps.Publisher().subscribe(self.UpdateCursorPosition,
27 27 'Update cursor position in slice')
  28 + ps.Publisher().subscribe(self.UpdateCursorPositionSingleAxis,
  29 + 'Update cursor single position in slice')
28 30 # General slice control
29 31 ps.Publisher().subscribe(self.CreateSurfaceFromIndex,
30 32 'Create surface from index')
... ... @@ -336,6 +338,19 @@ class Slice(object):
336 338 self.cast_filter.Update()
337 339 ps.Publisher().sendMessage('Update slice viewer')
338 340  
  341 +
  342 + def UpdateCursorPositionSingleAxis(self, pubsub_evt):
  343 + axis_pos = pubsub_evt.data
  344 + x, y, z = self.cross.GetCursorPosition()
  345 + new_pos = [x,y,z]
  346 + for key in axis_pos:
  347 + new_pos[key] = axis_pos[key]
  348 + self.cross.SetCursorPosition(new_pos)
  349 + self.cross.Modified()
  350 + self.cast_filter.Update()
  351 + ps.Publisher().sendMessage('Update slice viewer')
  352 +
  353 +
339 354 def __create_background(self, imagedata):
340 355  
341 356 thresh_min, thresh_max = imagedata.GetScalarRange()
... ...
invesalius/data/viewer_slice.py
... ... @@ -463,7 +463,13 @@ class Viewer(wx.Panel):
463 463 self.text_actor.SetInput(str(index))
464 464 self.slice_number = index
465 465 self.__update_display_extent()
466   - actor_bound = self.actor.GetBounds()
  466 +
  467 + position = {"SAGITAL": {0: self.slice_number},
  468 + "CORONAL": {1: self.slice_number},
  469 + "AXIAL": {2: self.slice_number}}
  470 +
  471 + ps.Publisher().sendMessage('Update cursor single position in slice',
  472 + position[self.orientation])
467 473  
468 474 def ChangeSliceNumber(self, pubsub_evt):
469 475 index = pubsub_evt.data
... ...