24 for (
unsigned i = 0; i < data->
mPositions.size(); i++)
39 for (
unsigned i = 0; i < data->
mFrames.size(); i++)
42 data->
mFrames[i].mPos = rMpr * prMt * tMv;
49 std::vector<double> error(data->
mFrames.size(), 1000);
54 for (
unsigned i_frame = 0; i_frame < data->
mFrames.size(); i_frame++)
56 std::vector<TimedPosition>::iterator posIter;
59 unsigned i_pos = distance(data->
mPositions.begin(), posIter);
66 double diff1 = fabs(data->
mFrames[i_frame].mTime - data->
mPositions[i_pos].mTime);
67 double diff2 = fabs(data->
mFrames[i_frame].mTime - data->
mPositions[i_pos + 1].mTime);
68 double diff = std::max(diff1, diff2);
72 if (!
similar(t_delta_tracking, 0))
73 t = (data->
mFrames[i_frame].mTime - data->
mPositions[i_pos].mTime) / t_delta_tracking;
75 error[i_frame] = diff;
84 Eigen::Quaterniond aq = Eigen::Quaterniond(a.matrix().block<3, 3>(0,0));
85 Eigen::Quaterniond bq = Eigen::Quaterniond(b.matrix().block<3, 3>(0,0));
87 Eigen::Quaterniond cq = aq.slerp(t, bq);
90 c.matrix().block<3, 3>(0, 0) = Eigen::Matrix3d(cq);
92 for (
int i = 0; i < 4; i++)
93 c(i, 3) = (1 - t) * a(i, 3) + t * b(i, 3);
100 for (
int i = 0; i < 4; i++)
101 for (
int j = 0; j < 4; j++)
102 c(i, j) = (1 - t) * a(i, j) + t * b(i, j);
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
Transform3D get_uMv() const
get transform from inverted image space v (origin in ul corner) to image space u. ...
Transform3D get_tMu() const
get transform from image space u to probe tool space t.
bool similar(const CameraInfo &lhs, const CameraInfo &rhs, double tol)
Namespace for all CustusX production code.