Commit f5086bb024722c05b6c557f495f20c03a6ca25c8

Authored by okahilak
Committed by GitHub
1 parent 2fbc32ff
Exists in master

FIX: A bug in navigation without a target (#296)

- Check that the target is not None before transforming it in
  CoordinateCorregistrate class.

Co-authored-by: Olli-Pekka Kahilakoski <olli-pekka.kahilakoski@aalto.fi>
Showing 1 changed file with 8 additions and 6 deletions   Show diff stats
invesalius/data/coregistration.py
... ... @@ -186,14 +186,16 @@ class CoordinateCorregistrate(threading.Thread):
186 186 self.m_icp = None
187 187 self.last_coord = None
188 188 self.tracker_id = tracker_id
  189 + self.target = target
189 190  
190   - self.target = np.array(target)
  191 + if self.target is not None:
  192 + self.target = np.array(self.target)
191 193  
192   - # XXX: Not sure why this is done, but a similar thing is done in OnUpdateTargetCoordinates
193   - # in viewer_volume.py, so this makes them match. A better solution would probably be to
194   - # do this transformation only once, and doing it in the correct place.
195   - #
196   - self.target[1] = -self.target[1]
  194 + # XXX: Not sure why this is done, but a similar thing is done in OnUpdateTargetCoordinates
  195 + # in viewer_volume.py, so this makes them match. A better solution would probably be to
  196 + # do this transformation only once, and doing it in the correct place.
  197 + #
  198 + self.target[1] = -self.target[1]
197 199  
198 200 def run(self):
199 201 trck_info = self.trck_info
... ...