Commit ef60a61bd31f4b83186648f016581bec7d01d2bf

Authored by Paulo Henrique Junqueira Amorim
1 parent 6c8ae9b6

ENH: Changed constant from keyUP and keyDown, represented with number to constan…

…t of the wx (wx.WXK_UP and wx.WXK_DOWN)
Showing 1 changed file with 14 additions and 14 deletions   Show diff stats
invesalius/data/viewer_slice.py
... ... @@ -355,9 +355,9 @@ class Viewer(wx.Panel):
355 355 ###
356 356 ps.Publisher().subscribe(self.ChangeBrushSize,
357 357 'Set edition brush size')
358   - ps.Publisher().subscribe(self.ChangeBrushColour,
  358 + ps.Publisher().subscribe(self.ChangeBrushColour,
359 359 'Add mask')
360   - ps.Publisher().subscribe(self.ChangeBrushActor,
  360 + ps.Publisher().subscribe(self.ChangeBrushActor,
361 361 'Set brush format')
362 362 ps.Publisher().subscribe(self.ChangeBrushOperation,
363 363 'Set edition operation')
... ... @@ -379,7 +379,7 @@ class Viewer(wx.Panel):
379 379 proportion_y = 1.0 / self.layout[1]
380 380 for i in xrange(self.layout[0]):
381 381 for j in xrange(self.layout[1]):
382   - position = ((i*proportion_x, j * proportion_y,
  382 + position = ((i*proportion_x, j * proportion_y,
383 383 (i+1)*proportion_x, (j+1)*proportion_y))
384 384 slice_data = self.create_slice_window(image)
385 385 slice_data.renderer.SetViewport(position)
... ... @@ -456,12 +456,12 @@ class Viewer(wx.Panel):
456 456 if (slice_data.cursor):
457 457 slice_number = slice_data.number
458 458 actor_bound = slice_data.actor.GetBounds()
459   -
  459 +
460 460 yz = [actor_bound[1] + 1 + slice_number, y, z]
461 461 xz = [x, actor_bound[3] - 1 - slice_number, z]
462 462 xy = [x, y, actor_bound[5] + 1 + slice_number]
463   -
464   - proj = project.Project()
  463 +
  464 + proj = project.Project()
465 465 orig_orien = proj.original_orientation
466 466  
467 467 if (orig_orien == const.SAGITAL):
... ... @@ -470,7 +470,7 @@ class Viewer(wx.Panel):
470 470 coordinates = {"SAGITAL": yz, "CORONAL": xy, "AXIAL": xz}
471 471 else:
472 472 coordinates = {"SAGITAL": yz, "CORONAL": xz, "AXIAL": xy}
473   -
  473 +
474 474 slice_data.cursor.SetPosition(coordinates[self.orientation])
475 475  
476 476 def SetOrientation(self, orientation):
... ... @@ -494,7 +494,7 @@ class Viewer(wx.Panel):
494 494 orientation = self.orientation
495 495 proj = project.Project()
496 496 orig_orien = proj.original_orientation
497   -
  497 +
498 498 cam = slice_data.renderer.GetActiveCamera()
499 499 cam.SetFocalPoint(0, 0, 0)
500 500 cam.SetViewUp(const.SLICE_POSITION[orig_orien][0][self.orientation])
... ... @@ -513,15 +513,15 @@ class Viewer(wx.Panel):
513 513 proj = project.Project()
514 514  
515 515 pos = slice_data.number
516   -
  516 +
517 517 x = (pos, pos, e[2], e[3], e[4], e[5])
518 518 y = (e[0], e[1], pos, pos, e[4], e[5])
519 519 z = (e[0], e[1], e[2], e[3], pos, pos)
520   -
521   - if (proj.original_orientation == const.AXIAL):
  520 +
  521 + if (proj.original_orientation == const.AXIAL):
522 522 new_extent = {"SAGITAL": x, "CORONAL": y, "AXIAL": z}
523 523 elif(proj.original_orientation == const.SAGITAL):
524   - new_extent = {"SAGITAL": z,"CORONAL": x,"AXIAL": y}
  524 + new_extent = {"SAGITAL": z,"CORONAL": x,"AXIAL": y}
525 525 elif(proj.original_orientation == const.CORONAL):
526 526 new_extent = {"SAGITAL": x,"CORONAL": z,"AXIAL": y}
527 527  
... ... @@ -548,11 +548,11 @@ class Viewer(wx.Panel):
548 548 min = 0
549 549 max = self.actor.GetSliceNumberMax()
550 550  
551   - if (evt.GetKeyCode() == 315 and pos > min):
  551 + if (evt.GetKeyCode() == wx.WXK_UP and pos > min):
552 552 pos = pos - 1
553 553 self.scroll.SetThumbPosition(pos)
554 554 self.OnScrollBar()
555   - elif (evt.GetKeyCode() == 317 and pos < max):
  555 + elif (evt.GetKeyCode() == wx.WXK_DOWN and pos < max):
556 556 pos = pos + 1
557 557 self.scroll.SetThumbPosition(pos)
558 558 self.OnScrollBar()
... ...