From f5086bb024722c05b6c557f495f20c03a6ca25c8 Mon Sep 17 00:00:00 2001 From: okahilak <49641103+okahilak@users.noreply.github.com> Date: Wed, 21 Jul 2021 01:09:59 +0300 Subject: [PATCH] FIX: A bug in navigation without a target (#296) --- invesalius/data/coregistration.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/invesalius/data/coregistration.py b/invesalius/data/coregistration.py index 07937b6..d315379 100644 --- a/invesalius/data/coregistration.py +++ b/invesalius/data/coregistration.py @@ -186,14 +186,16 @@ class CoordinateCorregistrate(threading.Thread): self.m_icp = None self.last_coord = None self.tracker_id = tracker_id + self.target = target - self.target = np.array(target) + if self.target is not None: + self.target = np.array(self.target) - # XXX: Not sure why this is done, but a similar thing is done in OnUpdateTargetCoordinates - # in viewer_volume.py, so this makes them match. A better solution would probably be to - # do this transformation only once, and doing it in the correct place. - # - self.target[1] = -self.target[1] + # XXX: Not sure why this is done, but a similar thing is done in OnUpdateTargetCoordinates + # in viewer_volume.py, so this makes them match. A better solution would probably be to + # do this transformation only once, and doing it in the correct place. + # + self.target[1] = -self.target[1] def run(self): trck_info = self.trck_info -- libgit2 0.21.2