Commit 8c526577530f7bb73533c7a732c31029157d0d86
1 parent
839d45c1
Exists in
master
ENH: more name refractor
Showing
2 changed files
with
8 additions
and
8 deletions
Show diff stats
invesalius/data/elfin_processing.py
@@ -96,7 +96,7 @@ class TrackerProcessing: | @@ -96,7 +96,7 @@ class TrackerProcessing: | ||
96 | 96 | ||
97 | return velocity, distance | 97 | return velocity, distance |
98 | 98 | ||
99 | - def versors(self, init_point, final_point): | 99 | + def compute_versors(self, init_point, final_point): |
100 | init_point = np.array(init_point) | 100 | init_point = np.array(init_point) |
101 | final_point = np.array(final_point) | 101 | final_point = np.array(final_point) |
102 | norm = (sum((final_point - init_point) ** 2)) ** 0.5 | 102 | norm = (sum((final_point - init_point) ** 2)) ** 0.5 |
@@ -109,7 +109,7 @@ class TrackerProcessing: | @@ -109,7 +109,7 @@ class TrackerProcessing: | ||
109 | 109 | ||
110 | pc = coord_head[0], coord_head[1], coord_head[2], coord_inv[3], coord_inv[4], coord_inv[5] | 110 | pc = coord_head[0], coord_head[1], coord_head[2], coord_inv[3], coord_inv[4], coord_inv[5] |
111 | 111 | ||
112 | - versorfactor1 = self.versors(pc, actual_point) | 112 | + versorfactor1 = self.compute_versors(pc, actual_point) |
113 | init_ext_point = actual_point[0] + versorfactor1[0], \ | 113 | init_ext_point = actual_point[0] + versorfactor1[0], \ |
114 | actual_point[1] + versorfactor1[1], \ | 114 | actual_point[1] + versorfactor1[1], \ |
115 | actual_point[2] + versorfactor1[2], \ | 115 | actual_point[2] + versorfactor1[2], \ |
@@ -120,12 +120,12 @@ class TrackerProcessing: | @@ -120,12 +120,12 @@ class TrackerProcessing: | ||
120 | (p1[2] + actual_point[2]) / 2, | 120 | (p1[2] + actual_point[2]) / 2, |
121 | 0, 0, 0) | 121 | 0, 0, 0) |
122 | 122 | ||
123 | - newarr = (np.array(self.versors(pc, middle_point))) * 2 | 123 | + newarr = (np.array(self.compute_versors(pc, middle_point))) * 2 |
124 | middle_arc_point = middle_point[0] + newarr[0], \ | 124 | middle_arc_point = middle_point[0] + newarr[0], \ |
125 | middle_point[1] + newarr[1], \ | 125 | middle_point[1] + newarr[1], \ |
126 | middle_point[2] + newarr[2] | 126 | middle_point[2] + newarr[2] |
127 | 127 | ||
128 | - versorfactor3 = self.versors(pc, p1) | 128 | + versorfactor3 = self.compute_versors(pc, p1) |
129 | 129 | ||
130 | final_ext_arc_point = p1[0] + versorfactor3[0], \ | 130 | final_ext_arc_point = p1[0] + versorfactor3[0], \ |
131 | p1[1] + versorfactor3[1], \ | 131 | p1[1] + versorfactor3[1], \ |
@@ -136,7 +136,7 @@ class TrackerProcessing: | @@ -136,7 +136,7 @@ class TrackerProcessing: | ||
136 | 136 | ||
137 | return init_ext_point, target_arc | 137 | return init_ext_point, target_arc |
138 | 138 | ||
139 | - def head_move_threshold(self, current_ref): | 139 | + def compute_head_move_threshold(self, current_ref): |
140 | self.coord_vel.append(current_ref) | 140 | self.coord_vel.append(current_ref) |
141 | self.timestamp.append(time()) | 141 | self.timestamp.append(time()) |
142 | if len(self.coord_vel) >= 10: | 142 | if len(self.coord_vel) >= 10: |
invesalius/navigation/robot.py
@@ -194,7 +194,7 @@ class ControlRobot(threading.Thread): | @@ -194,7 +194,7 @@ class ControlRobot(threading.Thread): | ||
194 | 194 | ||
195 | self.trck_init_robot.SendCoordinates(coord, self.arc_motion_step_flag) | 195 | self.trck_init_robot.SendCoordinates(coord, self.arc_motion_step_flag) |
196 | 196 | ||
197 | - def control(self, coords_tracker_in_robot, coord_robot_raw, markers_flag): | 197 | + def robot_control(self, coords_tracker_in_robot, coord_robot_raw, markers_flag): |
198 | coord_ref_tracker_in_robot = coords_tracker_in_robot[1] | 198 | coord_ref_tracker_in_robot = coords_tracker_in_robot[1] |
199 | coord_obj_tracker_in_robot = coords_tracker_in_robot[2] | 199 | coord_obj_tracker_in_robot = coords_tracker_in_robot[2] |
200 | 200 | ||
@@ -202,7 +202,7 @@ class ControlRobot(threading.Thread): | @@ -202,7 +202,7 @@ class ControlRobot(threading.Thread): | ||
202 | current_ref = coord_ref_tracker_in_robot | 202 | current_ref = coord_ref_tracker_in_robot |
203 | if current_ref is not None and markers_flag[1]: | 203 | if current_ref is not None and markers_flag[1]: |
204 | current_ref_filtered = self.process_tracker.kalman_filter(current_ref) | 204 | current_ref_filtered = self.process_tracker.kalman_filter(current_ref) |
205 | - if self.process_tracker.head_move_threshold(current_ref_filtered): | 205 | + if self.process_tracker.compute_head_move_threshold(current_ref_filtered): |
206 | coord_inv = self.process_tracker.head_move_compensation(current_ref_filtered, | 206 | coord_inv = self.process_tracker.head_move_compensation(current_ref_filtered, |
207 | self.m_change_robot_to_head) | 207 | self.m_change_robot_to_head) |
208 | if self.coord_inv_old is None: | 208 | if self.coord_inv_old is None: |
@@ -237,4 +237,4 @@ class ControlRobot(threading.Thread): | @@ -237,4 +237,4 @@ class ControlRobot(threading.Thread): | ||
237 | self.target_flag = self.object_at_target_queue.get_nowait() | 237 | self.target_flag = self.object_at_target_queue.get_nowait() |
238 | self.object_at_target_queue.task_done() | 238 | self.object_at_target_queue.task_done() |
239 | 239 | ||
240 | - self.control(coords_tracker_in_robot, coord_robot_raw, markers_flag) | 240 | + self.robot_control(coords_tracker_in_robot, coord_robot_raw, markers_flag) |