NPL
Neurological Programs and Libraries
|
Struct for holding information about a rigid transform. Note that rotation R = Rx*Ry*Rz, where Rx, Ry, and Rz are the rotations about x, y and z aaxes, and the angles are stored (in radians) in the rotation member. More...
#include <registration.h>
Public Member Functions | |
Rigid3DTrans () | |
void | invert () |
Inverts rigid transform, where: More... | |
Matrix3d | rotMatrix () |
Constructs and returns rotation Matrix. More... | |
void | setRotation (const Matrix3d &rot) |
Constructs rotation vector from rotation matrix. More... | |
void | toRASCoords (ptr< const MRImage > in) |
Converts to world coordinates based on the orientation stored in input image. More... | |
void | toIndexCoords (ptr< const MRImage > in, bool forcegridcenter) |
Converts from world coordinates to index coordinates based on the orientation stored in input image. More... | |
Public Attributes | |
Vector3d | rotation |
Vector3d | shift |
Vector3d | center |
bool | ras_coord |
Indicates the stored transform is relative to physical coordintes rather than index coordinates. More... | |
Struct for holding information about a rigid transform. Note that rotation R = Rx*Ry*Rz, where Rx, Ry, and Rz are the rotations about x, y and z aaxes, and the angles are stored (in radians) in the rotation member.
Definition at line 855 of file registration.h.
|
inline |
Definition at line 867 of file registration.h.
void npl::Rigid3DTrans::invert | ( | ) |
Inverts rigid transform, where:
Original:
Inverse:
So the new parameters, interms of the old are:
Matrix3d npl::Rigid3DTrans::rotMatrix | ( | ) |
Constructs and returns rotation Matrix.
void npl::Rigid3DTrans::setRotation | ( | const Matrix3d & | rot | ) |
Constructs rotation vector from rotation matrix.
rot | Rotation matrix |
Converts from world coordinates to index coordinates based on the orientation stored in input image.
The center of rotation is assumed to be the center of the grid which is (SIZE-1)/2 in each dimension.
The Rotation ( ) and Shift( ) are given by:
where is the rotation of the grid, is the center of the grid, is the origin of the grid, is the rotation matrix in RAS coordinate space, is the given center of roation (in RAS coordinates), and is the original shift in RAS coordinates.
in | Source of index->world transform |
forcegridcenter | Force the center to be the center of the grid rather than using the location corresponding to the current center |
Converts to world coordinates based on the orientation stored in input image.
For a rotation in RAS coordinates, with rotation , shift and center :
From a rotation in index space with rotation , shift and center :
in | Source of index->world transform |
Vector3d npl::Rigid3DTrans::center |
Definition at line 859 of file registration.h.
bool npl::Rigid3DTrans::ras_coord |
Indicates the stored transform is relative to physical coordintes rather than index coordinates.
Definition at line 865 of file registration.h.
Vector3d npl::Rigid3DTrans::rotation |
Definition at line 857 of file registration.h.
Vector3d npl::Rigid3DTrans::shift |
Definition at line 858 of file registration.h.