Commit 5f72b336a345de1c87c0df79d2cf75414ca7dbb1

Authored by fabioaz
1 parent c9bb810e

ENH: Included new positioning labels for the orientation views. Fixed some little errors too.

Showing 1 changed file with 23 additions and 22 deletions   Show diff stats
invesalius/data/viewer_slice.py
@@ -432,12 +432,12 @@ class Viewer(wx.Panel): @@ -432,12 +432,12 @@ class Viewer(wx.Panel):
432 432
433 if((self.state == const.STATE_SPIN) and (self.spined_image)): 433 if((self.state == const.STATE_SPIN) and (self.spined_image)):
434 self.cam.SetViewUp(const.SLICE_POSITION[orig_orien][0][self.orientation]) 434 self.cam.SetViewUp(const.SLICE_POSITION[orig_orien][0][self.orientation])
435 - 435 + # Values are on ccw order, starting from the top:
436 if self.orientation == 'AXIAL': 436 if self.orientation == 'AXIAL':
437 values = [_("A"), _("R"), _("P"), _("L")] 437 values = [_("A"), _("R"), _("P"), _("L")]
438 - elif self.orientation == 'SAGITAL': 438 + elif self.orientation == 'CORONAL':
439 values = [_("T"), _("R"), _("B"), _("L")] 439 values = [_("T"), _("R"), _("B"), _("L")]
440 - else: 440 + else: # 'SAGITAL':
441 values = [_("T"), _("P"), _("B"), _("A")] 441 values = [_("T"), _("P"), _("B"), _("A")]
442 442
443 self.RenderTextDirection(values) 443 self.RenderTextDirection(values)
@@ -487,7 +487,7 @@ class Viewer(wx.Panel): @@ -487,7 +487,7 @@ class Viewer(wx.Panel):
487 # Window & Level text 487 # Window & Level text
488 self.wl_text = vtku.Text() 488 self.wl_text = vtku.Text()
489 self.SetWLText(proj.level, proj.window) 489 self.SetWLText(proj.level, proj.window)
490 - # Orientation texea 490 + # Orientation text
491 if self.orientation == 'AXIAL': 491 if self.orientation == 'AXIAL':
492 values = [_('R'), _('L'), _('A'), _('P')] 492 values = [_('R'), _('L'), _('A'), _('P')]
493 elif self.orientation == 'SAGITAL': 493 elif self.orientation == 'SAGITAL':
@@ -536,10 +536,11 @@ class Viewer(wx.Panel): @@ -536,10 +536,11 @@ class Viewer(wx.Panel):
536 self.slice_data.renderer.AddActor(down_text.actor) 536 self.slice_data.renderer.AddActor(down_text.actor)
537 537
538 def RenderTextDirection(self, directions): 538 def RenderTextDirection(self, directions):
  539 + # Values are on ccw order, starting from the top:
539 self.up_text.SetValue(directions[0]) 540 self.up_text.SetValue(directions[0])
540 - self.right_text.SetValue(directions[3])  
541 - self.down_text.SetValue(directions[2])  
542 self.left_text.SetValue(directions[1]) 541 self.left_text.SetValue(directions[1])
  542 + self.down_text.SetValue(directions[2])
  543 + self.right_text.SetValue(directions[3])
543 self.interactor.Render() 544 self.interactor.Render()
544 545
545 546
@@ -589,16 +590,16 @@ class Viewer(wx.Panel): @@ -589,16 +590,16 @@ class Viewer(wx.Panel):
589 self.RenderTextDirection([_("T"), _("R"), _("B"), _("L")]) 590 self.RenderTextDirection([_("T"), _("R"), _("B"), _("L")])
590 591
591 elif(croll > 1 and croll <= 44): 592 elif(croll > 1 and croll <= 44):
592 - self.RenderTextDirection([_("TL"), _("RT"), _("BR"), _("LI")]) 593 + self.RenderTextDirection([_("TL"), _("RT"), _("BR"), _("LB")])
593 594
594 elif(croll > 44 and croll <= 88): 595 elif(croll > 44 and croll <= 88):
595 - self.RenderTextDirection([_("LS"), _("TR"), _("RB"), _("L")]) 596 + self.RenderTextDirection([_("LT"), _("TR"), _("RB"), _("BL")])
596 597
597 elif(croll > 89 and croll <= 91): 598 elif(croll > 89 and croll <= 91):
598 self.RenderTextDirection([_("L"), _("T"), _("R"), _("B")]) 599 self.RenderTextDirection([_("L"), _("T"), _("R"), _("B")])
599 600
600 elif(croll > 91 and croll <= 135): 601 elif(croll > 91 and croll <= 135):
601 - self.RenderTextDirection([_("BI"), _("TL"), _("RT"), _("BR")]) 602 + self.RenderTextDirection([_("LB"), _("TL"), _("RT"), _("BR")])
602 603
603 elif(croll > 135 and croll <= 177): 604 elif(croll > 135 and croll <= 177):
604 self.RenderTextDirection([_("BL"), _("LT"), _("TR"), _("RB")]) 605 self.RenderTextDirection([_("BL"), _("LT"), _("TR"), _("RB")])
@@ -622,21 +623,30 @@ class Viewer(wx.Panel): @@ -622,21 +623,30 @@ class Viewer(wx.Panel):
622 self.RenderTextDirection([_("TR"), _("RB"), _("BL"), _("LT")]) 623 self.RenderTextDirection([_("TR"), _("RB"), _("BL"), _("LT")])
623 624
624 elif(self.orientation == "SAGITAL"): 625 elif(self.orientation == "SAGITAL"):
625 -  
626 - if (croll >= -2 and croll <= 1): 626 +
  627 + if(croll >= -101 and croll <= -87):
  628 + self.RenderTextDirection([_("T"), _("P"), _("B"), _("A")])
  629 +
  630 + elif(croll >= -86 and croll <= -42):
  631 + self.RenderTextDirection([_("TA"), _("PT"), _("BP"), _("AB")])
  632 +
  633 + elif(croll >= -41 and croll <= -2):
  634 + self.RenderTextDirection([_("AT"), _("TP"), _("PB"), _("BA")])
  635 +
  636 + elif (croll >= -2 and croll <= 1):
627 self.RenderTextDirection([_("A"), _("T"), _("P"), _("B")]) 637 self.RenderTextDirection([_("A"), _("T"), _("P"), _("B")])
628 638
629 elif(croll > 1 and croll <= 44): 639 elif(croll > 1 and croll <= 44):
630 self.RenderTextDirection([_("AB"), _("TA"), _("PT"), _("BP")]) 640 self.RenderTextDirection([_("AB"), _("TA"), _("PT"), _("BP")])
631 641
632 elif(croll > 44 and croll <= 88): 642 elif(croll > 44 and croll <= 88):
633 - self.RenderTextDirection([_("BA"), _("AS"), _("TP"), _("PB")]) 643 + self.RenderTextDirection([_("BA"), _("AT"), _("TP"), _("PB")])
634 644
635 elif(croll > 89 and croll <= 91): 645 elif(croll > 89 and croll <= 91):
636 self.RenderTextDirection([_("B"), _("A"), _("T"), _("P")]) 646 self.RenderTextDirection([_("B"), _("A"), _("T"), _("P")])
637 647
638 elif(croll > 91 and croll <= 135): 648 elif(croll > 91 and croll <= 135):
639 - self.RenderTextDirection([_("BP"), _("AB"), _("SA"), _("PT")]) 649 + self.RenderTextDirection([_("BP"), _("AB"), _("TA"), _("PT")])
640 650
641 elif(croll > 135 and croll <= 177): 651 elif(croll > 135 and croll <= 177):
642 self.RenderTextDirection([_("PB"), _("BA"), _("AT"), _("TP")]) 652 self.RenderTextDirection([_("PB"), _("BA"), _("AT"), _("TP")])
@@ -650,15 +660,6 @@ class Viewer(wx.Panel): @@ -650,15 +660,6 @@ class Viewer(wx.Panel):
650 elif(croll >= -132 and croll <= -101): 660 elif(croll >= -132 and croll <= -101):
651 self.RenderTextDirection([_("TP"), _("PB"), _("BA"), _("AT")]) 661 self.RenderTextDirection([_("TP"), _("PB"), _("BA"), _("AT")])
652 662
653 - elif(croll >= -101 and croll <= -87):  
654 - self.RenderTextDirection([_("T"), _("P"), _("B"), _("A")])  
655 -  
656 - elif(croll >= -86 and croll <= -42):  
657 - self.RenderTextDirection([_("TA"), _("PT"), _("BP"), _("AB")])  
658 -  
659 - elif(croll >= -41 and croll <= -2):  
660 - self.RenderTextDirection([_("AT"), _("TP"), _("PB"), _("BA")])  
661 -  
662 663
663 def Reposition(self, slice_data): 664 def Reposition(self, slice_data):
664 """ 665 """