Commit 6c487aa09bb183fa994aed792eb1572025e7837e

Authored by sotodela
1 parent 7ae6eefe
Exists in master

Add when converting to world space zeros when orientation is None

Showing 1 changed file with 12 additions and 5 deletions   Show diff stats
invesalius/gui/task_navigator.py
... ... @@ -1201,11 +1201,18 @@ class MarkersPanel(wx.Panel):
1201 1201 else:
1202 1202 res += ('%s\t' % str(getattr(self, field.name)))
1203 1203  
1204   - # Add world coordinates (in addition to the internal ones).
1205   - position_world, orientation_world = imagedata_utils.convert_invesalius_to_world(
1206   - position=[self.x, self.y, self.z],
1207   - orientation=[self.alpha, self.beta, self.gamma],
1208   - )
  1204 + if self.alpha is not None and self.beta is not None and self.gamma is not None:
  1205 + # Add world coordinates (in addition to the internal ones).
  1206 + position_world, orientation_world = imagedata_utils.convert_invesalius_to_world(
  1207 + position=[self.x, self.y, self.z],
  1208 + orientation=[self.alpha, self.beta, self.gamma],
  1209 + )
  1210 +
  1211 + else:
  1212 + position_world, orientation_world = imagedata_utils.convert_invesalius_to_world(
  1213 + position=[self.x, self.y, self.z],
  1214 + orientation=[0,0,0],
  1215 + )
1209 1216  
1210 1217 res += '\t'.join(map(lambda x: 'N/A' if x is None else str(x), (*position_world, *orientation_world)))
1211 1218 return res
... ...