Functions | |
int | hornAbsOrientation (const Eigen::MatrixXd &refPoints, const Eigen::MatrixXd &targetPoints, std::vector< double > *quat, double *rmsd, std::vector< double > *rmsdList, double *scale) |
Get the absolute orientation using Horn's algorithm (with quaternions) More... | |
Eigen::MatrixXd | calcMatrixS (const Eigen::MatrixXd ¢eredRefPnts, const Eigen::MatrixXd ¢eredTargetPnts, int nop, int dim) |
Eigen::MatrixXd | calcMatrixN (const Eigen::MatrixXd &S) |
Eigen::MatrixXd | centerWRTcentroid (const Eigen::MatrixXd &pointSet) |
Center a point set wrt the centroid. More... | |
double | calcScaleFactor (const Eigen::MatrixXd &rightSys, const Eigen::MatrixXd &leftSys, int n) |
Calculate the scale factor from the centered left and right point sets. More... | |
Eigen::MatrixXd | quat2RotMatrix (const Eigen::VectorXd &quat) |
Get a rotation matrix from a unit quaternion. More... | |
double | getRMSD (const Eigen::MatrixXd ¢eredRefPnts, const Eigen::MatrixXd ¢eredTargetPnts, const Eigen::VectorXd &quat, std::vector< double > *rmsdList, int nop, double scale) |
Calculate the RMSD. More... | |
Eigen::MatrixXd absor::calcMatrixN | ( | const Eigen::MatrixXd & | S | ) |
Compute the matrix N, a 4x4 symmetric matrix, by combining sums (saved as elements in the matrix S)
Compute the matrix \((4 \times 4)\) N, whose largest eigenvector corresponds to the optimal rotation. It is calculated from the elements of the \((3 \times 3)\) matrix S. The matrix N is:
N=[(Sxx+Syy+Szz) (Syz-Szy) (Szx-Sxz) (Sxy-Syx);...
(Syz-Szy) (Sxx-Syy-Szz) (Sxy+Syx) (Szx+Sxz);...
(Szx-Sxz) (Sxy+Syx) (-Sxx+Syy-Szz) (Syz+Szy);...
(Sxy-Syx) (Szx+Sxz) (Syz+Szy) (-Sxx-Syy+Szz)];
[in] | S | (3 \times 3) Eigen matrix whose elements are the sums of products of the coordinates measured in the left and right systems. |
Definition at line 172 of file absOrientation.cpp.
Eigen::MatrixXd absor::calcMatrixS | ( | const Eigen::MatrixXd & | centeredRefPnts, |
const Eigen::MatrixXd & | centeredTargetPnts, | ||
int | nop, | ||
int | dim | ||
) |
Compute the matrix S, or M, whose elements are the sums of products of coordinates measured in the left and right systems
Compute the matrix S, or M, whose elements are the sums of products of coordinates measured in the left and right systems. The matrix S is : S=[Sxx Sxy Sxz;... Syx Syy Syz;... Szx Szy Szz];
[in] | centeredRefPnts | The point set of the reference system (or right system), centered with respect to the centroid. This is a \( (n \times 3) \) Eigen matrix. Here, \( n \) is the number of particles. |
[in] | centeredTargetPnts | \( (n \times 3) \) Eigen matrix of the candidate/test system (or left system), centered with respect to the centroid. |
[in] | nop | The number of particles. |
[in] | dim | The number of dimensions = 3. |
Definition at line 131 of file absOrientation.cpp.
double absor::calcScaleFactor | ( | const Eigen::MatrixXd & | rightSys, |
const Eigen::MatrixXd & | leftSys, | ||
int | n | ||
) |
Calculate the scale factor from the centered left and right point sets.
Calculate the scale factor from the centered right and left point sets.
[in] | centeredRefPnts | The point set of the reference system (or right system), centered with respect to the centroid. This is a \( (n \times 3) \) Eigen matrix. Here, \( n \) is the number of particles. |
[in] | centeredTargetPnts | \( (n \times 3) \) Eigen matrix of the candidate/test system (or left system), centered with respect to the centroid. |
[in] | n | The number of points. |
Definition at line 276 of file absOrientation.cpp.
Eigen::MatrixXd absor::centerWRTcentroid | ( | const Eigen::MatrixXd & | pointSet | ) |
Center a point set wrt the centroid.
Centers a point set (which is an Eigen matrix), with respect to the centroid.
[in] | pointSet | \( (n \times 3) \) Eigen matrix for the point set. Here \( n \) is the number of points. |
Definition at line 228 of file absOrientation.cpp.
double absor::getRMSD | ( | const Eigen::MatrixXd & | centeredRefPnts, |
const Eigen::MatrixXd & | centeredTargetPnts, | ||
const Eigen::VectorXd & | quat, | ||
std::vector< double > * | rmsdList, | ||
int | nop, | ||
double | scale | ||
) |
Calculate the RMSD.
Get the root mean square of the errors from Horn's absolute orientation algorithm.
[in] | quat | The Eigen vector of length 4, for the input quaternion. |
[in] | centeredRefPnts | The point set of the reference system (or right system), centered with respect to the centroid. This is a \( (n \times 3) \) Eigen matrix. Here, \( n \) is the number of particles. |
[in] | centeredTargetPnts | \( (n \times 3) \) Eigen matrix of the candidate/test system (or left system), centered with respect to the centroid. |
[in] | quat | The Eigen vector of length 4, for the quaternion denoting the rotation. |
[in] | nop | The number of particles. |
[in] | scale | The scale factor |
Definition at line 359 of file absOrientation.cpp.
int absor::hornAbsOrientation | ( | const Eigen::MatrixXd & | refPoints, |
const Eigen::MatrixXd & | targetPoints, | ||
std::vector< double > * | quat, | ||
double * | rmsd, | ||
std::vector< double > * | rmsdList, | ||
double * | scale | ||
) |
Get the absolute orientation using Horn's algorithm (with quaternions)
Get the absolute orientation using Horn's algorithm (with quaternions). The algorithm is described in the linked paper.
[in] | refPoints | The point set of the reference system (or right system). This is a \( (n \times 3) \) Eigen matrix. Here, \( n \) is the number of particles. |
[in] | targetPoints | \( (n \times 3) \) Eigen matrix of the candidate/test system (or left system). |
[in,out] | quat | The quaternion for the optimum rotation of the left system into the right system. |
[in,out] | scale | The scale factor obtained from Horn's algorithm. |
Definition at line 30 of file absOrientation.cpp.
Eigen::MatrixXd absor::quat2RotMatrix | ( | const Eigen::VectorXd & | quat | ) |
Get a rotation matrix from a unit quaternion.
Get a \( (3 \times 3) \) rotation matrix from a unit quaternion.
[in] | quat | The Eigen vector of length 4, for the input quaternion. |
Definition at line 309 of file absOrientation.cpp.