Commit abb02132c09cb3ecc81834fff976a46c5bcea393
1 parent
d450b91b
Exists in
master
ENH: changed decompose matrix to dco.transformation_matrix_to_coordinates
Showing
2 changed files
with
7 additions
and
7 deletions
Show diff stats
invesalius/data/bases.py
... | ... | @@ -284,8 +284,8 @@ class transform_tracker_to_robot(object): |
284 | 284 | ) |
285 | 285 | M_tracker_in_robot = transform_tracker_to_robot.M_tracker_to_robot @ M_tracker |
286 | 286 | |
287 | - _, _, angles, translate, _ = tr.decompose_matrix(M_tracker_in_robot) | |
288 | - tracker_in_robot = [translate[0], translate[1], translate[2], \ | |
289 | - np.degrees(angles[2]), np.degrees(angles[1]), np.degrees(angles[0])] | |
287 | + # TODO: check this with robot | |
288 | + translation, angles_as_deg = dco.transformation_matrix_to_coordinates(M_tracker_in_robot, axes='rzyx') | |
289 | + tracker_in_robot = list(translation) + list(angles_as_deg) | |
290 | 290 | |
291 | 291 | return tracker_in_robot | ... | ... |
invesalius/data/elfin_processing.py
... | ... | @@ -175,11 +175,11 @@ class TrackerProcessing: |
175 | 175 | axes='rzyx', |
176 | 176 | ) |
177 | 177 | m_robot_new = M_current_head @ m_change_robot_to_head |
178 | - _, _, angles, translate, _ = tr.decompose_matrix(m_robot_new) | |
179 | - angles = np.degrees(angles) | |
178 | + #TODO: check this with robot | |
179 | + translation, angles_as_deg = dco.transformation_matrix_to_coordinates(m_robot_new, axes='sxyz') | |
180 | + new_robot_position = list(translation) + list(angles_as_deg) | |
180 | 181 | |
181 | - return m_robot_new[0, -1], m_robot_new[1, -1], m_robot_new[2, -1], angles[0], angles[1], \ | |
182 | - angles[2] | |
182 | + return new_robot_position | |
183 | 183 | |
184 | 184 | def estimate_head_center(self, tracker, current_head): |
185 | 185 | """ | ... | ... |