Commit dadfc342f2d7861d6c07f2e3666dcf05120a0d0b
1 parent
1e7096e6
Exists in
master
and in
67 other branches
Circle pencil is rotated based only in the orientation not in original orientation
Showing
1 changed file
with
4 additions
and
22 deletions
Show diff stats
invesalius/data/cursor_actors.py
| @@ -29,9 +29,7 @@ import utils | @@ -29,9 +29,7 @@ import utils | ||
| 29 | class CursorCircle: | 29 | class CursorCircle: |
| 30 | # TODO: Think and try to change this class to an actor | 30 | # TODO: Think and try to change this class to an actor |
| 31 | # CursorCircleActor(vtk.vtkActor) | 31 | # CursorCircleActor(vtk.vtkActor) |
| 32 | - | ||
| 33 | def __init__(self): | 32 | def __init__(self): |
| 34 | - | ||
| 35 | self.colour = (0.0, 0.0, 1.0) | 33 | self.colour = (0.0, 0.0, 1.0) |
| 36 | self.opacity = 1 | 34 | self.opacity = 1 |
| 37 | self.radius = 15.0 | 35 | self.radius = 15.0 |
| @@ -51,7 +49,6 @@ class CursorCircle: | @@ -51,7 +49,6 @@ class CursorCircle: | ||
| 51 | """ | 49 | """ |
| 52 | Function to plot the circle | 50 | Function to plot the circle |
| 53 | """ | 51 | """ |
| 54 | - | ||
| 55 | r = self.radius | 52 | r = self.radius |
| 56 | t = 0 | 53 | t = 0 |
| 57 | 54 | ||
| @@ -108,7 +105,6 @@ class CursorCircle: | @@ -108,7 +105,6 @@ class CursorCircle: | ||
| 108 | index = (y*sy)**2 + (x*sx)**2 <= radius**2 | 105 | index = (y*sy)**2 + (x*sx)**2 <= radius**2 |
| 109 | self.points = index | 106 | self.points = index |
| 110 | 107 | ||
| 111 | - | ||
| 112 | def SetSize(self, diameter): | 108 | def SetSize(self, diameter): |
| 113 | radius = self.radius = diameter/2.0 | 109 | radius = self.radius = diameter/2.0 |
| 114 | #self.disk.SetInnerRadius(radius-1) # filled = self.radius | 110 | #self.disk.SetInnerRadius(radius-1) # filled = self.radius |
| @@ -116,8 +112,6 @@ class CursorCircle: | @@ -116,8 +112,6 @@ class CursorCircle: | ||
| 116 | self.__build_actor() | 112 | self.__build_actor() |
| 117 | self.__calculate_area_pixels() | 113 | self.__calculate_area_pixels() |
| 118 | 114 | ||
| 119 | - | ||
| 120 | - | ||
| 121 | def SetColour(self, colour): | 115 | def SetColour(self, colour): |
| 122 | self.colour = colour | 116 | self.colour = colour |
| 123 | self.actor.GetProperty().SetColor(colour) | 117 | self.actor.GetProperty().SetColor(colour) |
| @@ -126,21 +120,10 @@ class CursorCircle: | @@ -126,21 +120,10 @@ class CursorCircle: | ||
| 126 | self.orientation = orientation | 120 | self.orientation = orientation |
| 127 | proj = Project() | 121 | proj = Project() |
| 128 | orig_orien = proj.original_orientation | 122 | orig_orien = proj.original_orientation |
| 129 | - if (orig_orien == const.SAGITAL): | ||
| 130 | - if orientation == "CORONAL": | ||
| 131 | - self.actor.RotateY(90) | ||
| 132 | - if orientation == "AXIAL": | ||
| 133 | - self.actor.RotateX(90) | ||
| 134 | - elif(orig_orien == const.CORONAL): | ||
| 135 | - if orientation == "AXIAL": | ||
| 136 | - self.actor.RotateX(270) | ||
| 137 | - if orientation == "SAGITAL": | ||
| 138 | - self.actor.RotateY(90) | ||
| 139 | - else: | ||
| 140 | - if orientation == "CORONAL": | ||
| 141 | - self.actor.RotateX(90) | ||
| 142 | - if orientation == "SAGITAL": | ||
| 143 | - self.actor.RotateY(90) | 123 | + if orientation == "CORONAL": |
| 124 | + self.actor.RotateX(90) | ||
| 125 | + if orientation == "SAGITAL": | ||
| 126 | + self.actor.RotateY(90) | ||
| 144 | 127 | ||
| 145 | def SetPosition(self, position): | 128 | def SetPosition(self, position): |
| 146 | self.position = position | 129 | self.position = position |
| @@ -164,7 +147,6 @@ class CursorCircle: | @@ -164,7 +147,6 @@ class CursorCircle: | ||
| 164 | 147 | ||
| 165 | 148 | ||
| 166 | class CursorRectangle: | 149 | class CursorRectangle: |
| 167 | - | ||
| 168 | def __init__(self): | 150 | def __init__(self): |
| 169 | 151 | ||
| 170 | self.colour = (0.0, 0.0, 1.0) | 152 | self.colour = (0.0, 0.0, 1.0) |