NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
Functions | |
void | ndiRelativeTransform (const double a[8], const double b[8], double c[8]) |
void | ndiTransformToMatrixf (const double trans[8], float matrix[16]) |
void | ndiTransformToMatrixd (const double trans[8], double matrix[16]) |
void | ndiAnglesFromMatrixf (float angles[3], const float matrix[16]) |
void | ndiAnglesFromMatrixd (double angles[3], const double matrix[16]) |
void | ndiCoordsFromMatrixf (float coords[3], const float matrix[16]) |
void | ndiCoordsFromMatrixd (double coords[3], const double matrix[16]) |
These are some useful math functions. Note that the matrices are stored using the OpenGL convention:
void ndiAnglesFromMatrixd | ( | double | angles[3], |
const double | matrix[16] | ||
) |
Extract rotation angles from a 4x4 double matrix. The order of the rotations is:
void ndiAnglesFromMatrixf | ( | float | angles[3], |
const float | matrix[16] | ||
) |
Extract rotation angles from a 4x4 float matrix. The order of the rotations is:
void ndiCoordsFromMatrixd | ( | double | coords[3], |
const double | matrix[16] | ||
) |
Extract position coordinates from a 4x4 double matrix. These have the same value as the position coordinates in the quaternion transformation.
void ndiCoordsFromMatrixf | ( | float | coords[3], |
const float | matrix[16] | ||
) |
Extract position coordinates from a 4x4 float matrix. These have the same value as the position coordinates in the quaternion transformation.
void ndiRelativeTransform | ( | const double | a[8], |
const double | b[8], | ||
double | c[8] | ||
) |
Find the position and orientation of a tool relative to a reference tool. This is done by quaternion division.
a | the original tool transformation |
b | the reference tool transformation |
c | the resulting relative transformation |
The pointer c can be the same as pointer a if you want to do the division in-place.
void ndiTransformToMatrixd | ( | const double | trans[8], |
double | matrix[16] | ||
) |
Convert a quaternion transformation into a 4x4 double matrix.
void ndiTransformToMatrixf | ( | const double | trans[8], |
float | matrix[16] | ||
) |
Convert a quaternion transformation into a 4x4 float matrix.