Commit 016cfd0c2c3e90537ce4eb8b1d698b5a79b560e0
1 parent
4e997fd4
Exists in
master
FRE after ICP
Showing
2 changed files
with
8 additions
and
8 deletions
Show diff stats
invesalius/data/bases.py
... | ... | @@ -183,13 +183,15 @@ def calculate_fre(fiducials_raw, fiducials, ref_mode_id, m_change, m_icp=None): |
183 | 183 | p2 = np.vstack([fiducials_raw[2, :], fiducials_raw[3, :]]) |
184 | 184 | p3 = np.vstack([fiducials_raw[4, :], fiducials_raw[5, :]]) |
185 | 185 | |
186 | - coreg_data = (m_change, 0) | |
187 | - p1_m, m_img = dcr.corregistrate_dynamic(coreg_data, p1, ref_mode_id, [None, None]) | |
188 | - p2_m, m_img = dcr.corregistrate_dynamic(coreg_data, p2, ref_mode_id, [None, None]) | |
189 | - p3_m, m_img = dcr.corregistrate_dynamic(coreg_data, p3, ref_mode_id, [None, None]) | |
186 | + if m_icp is not None: | |
187 | + icp = [True, m_icp] | |
188 | + else: | |
189 | + icp = [False, None] | |
190 | 190 | |
191 | - if m_icp: | |
192 | - m_img = transform_icp(m_img, m_icp) | |
191 | + coreg_data = (m_change, 0) | |
192 | + p1_m, m_img = dcr.corregistrate_dynamic(coreg_data, p1, ref_mode_id, icp) | |
193 | + p2_m, m_img = dcr.corregistrate_dynamic(coreg_data, p2, ref_mode_id, icp) | |
194 | + p3_m, m_img = dcr.corregistrate_dynamic(coreg_data, p3, ref_mode_id, icp) | |
193 | 195 | |
194 | 196 | print(p1_m) |
195 | 197 | print(fiducials[0, :]) | ... | ... |
invesalius/data/coregistration.py
... | ... | @@ -155,12 +155,10 @@ def corregistrate_dynamic(inp, coord_raw, ref_mode_id, icp): |
155 | 155 | else: |
156 | 156 | m_probe_ref = m_probe |
157 | 157 | |
158 | - print(m_probe_ref) | |
159 | 158 | # invert y coordinate |
160 | 159 | m_probe_ref[2, -1] = -m_probe_ref[2, -1] |
161 | 160 | # corregistrate from tracker to image space |
162 | 161 | m_img = m_change @ m_probe_ref |
163 | - print(m_img) | |
164 | 162 | |
165 | 163 | if icp[0]: |
166 | 164 | m_img = bases.transform_icp(m_img, icp[1]) | ... | ... |