Commit dc258558c12e170898169d8216709df8d9076893

Authored by Victor Hugo Souza
Committed by GitHub
2 parents c3a918a1 b8ba360e
Exists in master

Merge pull request #397 from rmatsuda/change-decompose-robot-matrix-method

Change decompose robot matrix method
invesalius/data/bases.py
@@ -284,8 +284,7 @@ class transform_tracker_to_robot(object): @@ -284,8 +284,7 @@ class transform_tracker_to_robot(object):
284 ) 284 )
285 M_tracker_in_robot = transform_tracker_to_robot.M_tracker_to_robot @ M_tracker 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 + translation, angles_as_deg = dco.transformation_matrix_to_coordinates(M_tracker_in_robot, axes='rzyx')
  288 + tracker_in_robot = list(translation) + list(angles_as_deg)
290 289
291 return tracker_in_robot 290 return tracker_in_robot
invesalius/data/elfin_processing.py
@@ -20,7 +20,6 @@ import numpy as np @@ -20,7 +20,6 @@ import numpy as np
20 import cv2 20 import cv2
21 from time import time 21 from time import time
22 22
23 -import invesalius.data.transformations as tr  
24 import invesalius.data.coregistration as dcr 23 import invesalius.data.coregistration as dcr
25 import invesalius.data.coordinates as dco 24 import invesalius.data.coordinates as dco
26 import invesalius.constants as const 25 import invesalius.constants as const
@@ -175,11 +174,11 @@ class TrackerProcessing: @@ -175,11 +174,11 @@ class TrackerProcessing:
175 axes='rzyx', 174 axes='rzyx',
176 ) 175 )
177 m_robot_new = M_current_head @ m_change_robot_to_head 176 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)  
180 177
181 - return m_robot_new[0, -1], m_robot_new[1, -1], m_robot_new[2, -1], angles[0], angles[1], \  
182 - angles[2] 178 + translation, angles_as_deg = dco.transformation_matrix_to_coordinates(m_robot_new, axes='sxyz')
  179 + new_robot_position = list(translation) + list(angles_as_deg)
  180 +
  181 + return new_robot_position
183 182
184 def estimate_head_center(self, tracker, current_head): 183 def estimate_head_center(self, tracker, current_head):
185 """ 184 """