Commit d9daf15769d03e3802e170c332c49687e65be242

Authored by okahilak
Committed by GitHub
1 parent bcc1eb4e
Exists in master

FIX: Bug in object registration, causing navigation to not work (#349)

* Due to a previous clean-up, r_s0_raw was not computed anymore
  in object_registration function. However, it is needed as one
  of the return values of the function, therefore add it back.
Showing 1 changed file with 7 additions and 0 deletions   Show diff stats
invesalius/data/bases.py
... ... @@ -188,6 +188,13 @@ def object_registration(fiducials, orients, coord_raw, m_change):
188 188 fids_raw[ic, :] = dco.dynamic_reference_m2(coords[ic, :], coords[3, :])[:3]
189 189  
190 190 # compute initial alignment of probe fixed in the object in source frame
  191 +
  192 + # XXX: Some duplicate processing is done here: the Euler angles are calculated once by
  193 + # the lines below, and then again in dco.coordinates_to_transformation_matrix.
  194 + #
  195 + a, b, g = np.radians(coords[3, 3:])
  196 + r_s0_raw = tr.euler_matrix(a, b, g, axes='rzyx')
  197 +
191 198 s0_raw = dco.coordinates_to_transformation_matrix(
192 199 position=coords[3, :3],
193 200 orientation=coords[3, 3:],
... ...