Class for permutation matrix that can be applied to pixel indexes, as well as dimension, and pixel size arrays. More...
#include <cmtkAnatomicalOrientation.h>
Public Types | |
typedef PermutationMatrix | Self |
This class. | |
typedef SmartPointer< Self > | SmartPtr |
Smart pointer to this class. | |
Public Member Functions | |
PermutationMatrix (const FixedVector< 3, int > &sourceDims, const std::string &curOrientation, const char newOrientation[3]) | |
Constructor: determine axes permutation, flipping, and store local copy of reoriented dimensions array. | |
template<class T > | |
const FixedVector< 3, T > | GetPermutedArray (const FixedVector< 3, T > &source) const |
Takes the dimensions of a volume (e.g. | |
AffineXform::MatrixType | GetPermutedMatrix (const AffineXform::MatrixType &inMatrix) const |
Permute index-to-physical matrix. | |
void | GetReorientedIndex (const int *origPoint, int *newPoint) const |
Get new point index from old point index. | |
size_t | NewOffsetFromPoint (const int *origPoint) const |
Applies the permutation described by this matrix to a pixel index. | |
Private Attributes | |
FixedVector< 3, int > | m_Axes |
Input-to-output axis index assignments. | |
FixedVector< 3, int > | m_Multipliers |
Multiplies (flip direction) table. | |
FixedVector< 3, int > | m_NewDims |
Dimension of the reoriented image in the direction of m_Axes[i]. | |
FixedVector< 3, int > | m_Offsets |
m_Offsets[i] contains 0 if m_Multipliers[i] == 1, and (m_NewDims[i] - 1) if m_Multipliers[i] == -1. |
Class for permutation matrix that can be applied to pixel indexes, as well as dimension, and pixel size arrays.
Definition at line 80 of file cmtkAnatomicalOrientation.h.
This class.
Definition at line 84 of file cmtkAnatomicalOrientation.h.
Smart pointer to this class.
Definition at line 87 of file cmtkAnatomicalOrientation.h.
const FixedVector<3,T> cmtk::AnatomicalOrientation::PermutationMatrix::GetPermutedArray | ( | const FixedVector< 3, T > & | source ) | const [inline] |
Takes the dimensions of a volume (e.g.
a grid, a voxel) and returns the dimensions of that volume after the reorientation described by this permutation matrix
source | Original array |
Definition at line 99 of file cmtkAnatomicalOrientation.h.
Referenced by cmtk::UniformVolume::GetReoriented(), and cmtk::DataGrid::GetReoriented().
void cmtk::AnatomicalOrientation::PermutationMatrix::GetReorientedIndex | ( | const int * | origPoint, |
int * | newPoint | ||
) | const [inline] |
Get new point index from old point index.
origPoint | The input pixel index in the original image grid. |
newPoint | The output pixel index in the reoriented image grid. |
Definition at line 117 of file cmtkAnatomicalOrientation.h.
size_t cmtk::AnatomicalOrientation::PermutationMatrix::NewOffsetFromPoint | ( | const int * | origPoint ) | const [inline] |
Applies the permutation described by this matrix to a pixel index.
origPoint | The input pixel index. |
Definition at line 127 of file cmtkAnatomicalOrientation.h.
Referenced by cmtk::DataGrid::GetReoriented().
FixedVector<3,int> cmtk::AnatomicalOrientation::PermutationMatrix::m_Axes [private] |
Input-to-output axis index assignments.
m_Axes[i] contains the index (0, 1, or 2) of the axis of the input orientation which gets moved to as the i'th axis of the output orientation. (where i is 0, 1, or 2, corresponding to X, Y, and Z, respectively)
Definition at line 144 of file cmtkAnatomicalOrientation.h.
FixedVector<3,int> cmtk::AnatomicalOrientation::PermutationMatrix::m_Multipliers [private] |
Multiplies (flip direction) table.
m_Multipliers[i] contains -1 if the axis at m_Axes[i] is to be reversed from its direction prior to re-orientation, and 1 otherwise
Definition at line 151 of file cmtkAnatomicalOrientation.h.
FixedVector<3,int> cmtk::AnatomicalOrientation::PermutationMatrix::m_NewDims [private] |
Dimension of the reoriented image in the direction of m_Axes[i].
Definition at line 156 of file cmtkAnatomicalOrientation.h.
FixedVector<3,int> cmtk::AnatomicalOrientation::PermutationMatrix::m_Offsets [private] |
m_Offsets[i] contains 0 if m_Multipliers[i] == 1, and (m_NewDims[i] - 1) if m_Multipliers[i] == -1.
(Since in the latter case, we will be writing from the highest-valued pixel in direction i and iterating backwards.)
Definition at line 164 of file cmtkAnatomicalOrientation.h.