From 6c487aa09bb183fa994aed792eb1572025e7837e Mon Sep 17 00:00:00 2001 From: sotodela Date: Mon, 29 Nov 2021 08:52:32 +0200 Subject: [PATCH] Add when converting to world space zeros when orientation is None --- invesalius/gui/task_navigator.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/invesalius/gui/task_navigator.py b/invesalius/gui/task_navigator.py index 1cdc247..9cd0524 100644 --- a/invesalius/gui/task_navigator.py +++ b/invesalius/gui/task_navigator.py @@ -1201,11 +1201,18 @@ class MarkersPanel(wx.Panel): else: res += ('%s\t' % str(getattr(self, field.name))) - # Add world coordinates (in addition to the internal ones). - position_world, orientation_world = imagedata_utils.convert_invesalius_to_world( - position=[self.x, self.y, self.z], - orientation=[self.alpha, self.beta, self.gamma], - ) + if self.alpha is not None and self.beta is not None and self.gamma is not None: + # Add world coordinates (in addition to the internal ones). + position_world, orientation_world = imagedata_utils.convert_invesalius_to_world( + position=[self.x, self.y, self.z], + orientation=[self.alpha, self.beta, self.gamma], + ) + + else: + position_world, orientation_world = imagedata_utils.convert_invesalius_to_world( + position=[self.x, self.y, self.z], + orientation=[0,0,0], + ) res += '\t'.join(map(lambda x: 'N/A' if x is None else str(x), (*position_world, *orientation_world))) return res -- libgit2 0.21.2