Commit 2147f2bc3e10bc5b9d4484569909859144c6ab6e

Authored by sotodela
1 parent 0f133510
Exists in master

ADD create arrow marker when orientation is not NAN

Showing 1 changed file with 15 additions and 15 deletions   Show diff stats
invesalius/gui/task_navigator.py
... ... @@ -1144,9 +1144,9 @@ class MarkersPanel(wx.Panel):
1144 1144 x : float = 0
1145 1145 y : float = 0
1146 1146 z : float = 0
1147   - alpha : float = None
1148   - beta : float = None
1149   - gamma : float = None
  1147 + alpha : float = dataclasses.field(default = None)
  1148 + beta : float = dataclasses.field(default = None)
  1149 + gamma : float = dataclasses.field(default = None)
1150 1150 r : float = 0
1151 1151 g : float = 1
1152 1152 b : float = 0
... ... @@ -1161,8 +1161,7 @@ class MarkersPanel(wx.Panel):
1161 1161 # x, y, z, alpha, beta, gamma can be jointly accessed as coord
1162 1162 @property
1163 1163 def coord(self):
1164   - print(self.alpha)
1165   - return list((self.x, self.y, self.z, self.alpha, self.beta, self.gamma),)
  1164 + return list((self.x, self.y, self.z, self.alpha, self.beta, self.gamma))
1166 1165  
1167 1166 @coord.setter
1168 1167 def coord(self, new_coord):
... ... @@ -1255,7 +1254,7 @@ class MarkersPanel(wx.Panel):
1255 1254 self.session = ses.Session()
1256 1255  
1257 1256 self.current_coord = 0, 0, 0, None, None, None
1258   - self.current_angle = None, None, None
  1257 + self.current_angle = None, None, None
1259 1258 self.current_seed = 0, 0, 0
1260 1259 self.current_robot_target_matrix = [None] * 9
1261 1260 self.markers = []
... ... @@ -1684,21 +1683,22 @@ class MarkersPanel(wx.Panel):
1684 1683 new_robot_marker.robot_target_matrix = self.current_robot_target_matrix
1685 1684  
1686 1685 # Note that ball_id is zero-based, so we assign it len(self.markers) before the new marker is added
1687   - if label not in self.__list_fiducial_labels():
1688   - Publisher.sendMessage('Add arrow marker', arrow_id=len(self.markers),
1689   - size=self.arrow_marker_size,
1690   - color=new_marker.colour,
1691   - coord=new_marker.coord)
  1686 + if label in self.__list_fiducial_labels():
  1687 + Publisher.sendMessage('Add marker', ball_id=len(self.markers),
  1688 + size=new_marker.size,
  1689 + colour=new_marker.colour,
  1690 + coord=new_marker.coord[:3])
  1691 +
1692 1692 elif new_marker.coord[5] is None:
1693 1693 Publisher.sendMessage('Add marker', ball_id=len(self.markers),
1694 1694 size=new_marker.size,
1695 1695 colour=new_marker.colour,
1696 1696 coord=new_marker.coord[:3])
1697 1697 else:
1698   - Publisher.sendMessage('Add marker', ball_id=len(self.markers),
1699   - size=new_marker.size,
1700   - colour=new_marker.colour,
1701   - coord=new_marker.coord[:3])
  1698 + Publisher.sendMessage('Add arrow marker', arrow_id=len(self.markers),
  1699 + size=self.arrow_marker_size,
  1700 + color=new_marker.colour,
  1701 + coord=new_marker.coord)
1702 1702  
1703 1703  
1704 1704 self.markers.append(new_marker)
... ...