Commit 84d9038f0a7c8cc05d8788476fd29ecbbd1024d0

Authored by Paulo Henrique Junqueira Amorim
1 parent 2cbdd050

FIX: Fixed bug in cursor of brush if orientation of the case is SAGITAL or CORONAL

Showing 1 changed file with 15 additions and 3 deletions   Show diff stats
invesalius/data/viewer_slice.py
... ... @@ -440,9 +440,21 @@ class Viewer(wx.Panel):
440 440 if (self.cursor):
441 441 slice_number = self.slice_number
442 442 actor_bound = self.actor.GetBounds()
443   - coordinates = {"SAGITAL": [actor_bound[1] + 1 + slice_number, y, z],
444   - "CORONAL": [x, actor_bound[3] - 1 - slice_number, z],
445   - "AXIAL": [x, y, actor_bound[5] + 1 + slice_number]}
  443 +
  444 + yz = [actor_bound[1] + 1 + slice_number, y, z]
  445 + xz = [x, actor_bound[3] - 1 - slice_number, z]
  446 + xy = [x, y, actor_bound[5] + 1 + slice_number]
  447 +
  448 + proj = project.Project()
  449 + orig_orien = proj.original_orientation
  450 +
  451 + if (orig_orien == const.SAGITAL):
  452 + coordinates = {"SAGITAL": xy, "CORONAL": yz, "AXIAL": xz}
  453 + elif(orig_orien == const.CORONAL):
  454 + coordinates = {"SAGITAL": yz, "CORONAL": xy, "AXIAL": xz}
  455 + else:
  456 + coordinates = {"SAGITAL": yz, "CORONAL": xz, "AXIAL": xy}
  457 +
446 458 self.cursor.SetPosition(coordinates[self.orientation])
447 459  
448 460 def set_orientation(self, orientation):
... ...