Public Types | Public Member Functions | Private Attributes

cmtk::AnatomicalOrientation::PermutationMatrix Class Reference

Class for permutation matrix that can be applied to pixel indexes, as well as dimension, and pixel size arrays. More...

#include <cmtkAnatomicalOrientation.h>

Collaboration diagram for cmtk::AnatomicalOrientation::PermutationMatrix:
Collaboration graph
[legend]

List of all members.

Public Types

typedef PermutationMatrix Self
 This class.
typedef SmartPointer< SelfSmartPtr
 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.

Detailed Description

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.


Member Typedef Documentation

This class.

Definition at line 84 of file cmtkAnatomicalOrientation.h.

Smart pointer to this class.

Definition at line 87 of file cmtkAnatomicalOrientation.h.


Member Function Documentation

template<class T >
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

Parameters:
sourceOriginal array
Returns:
target A three-element array to contain the permuted results.

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.

Parameters:
origPointThe input pixel index in the original image grid.
newPointThe 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.

Parameters:
origPointThe input pixel index.
Returns:
The offset of the corresponding pixel in the reoriented volume.

Definition at line 127 of file cmtkAnatomicalOrientation.h.

Referenced by cmtk::DataGrid::GetReoriented().


Member Data Documentation

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.

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.

Dimension of the reoriented image in the direction of m_Axes[i].

Definition at line 156 of file cmtkAnatomicalOrientation.h.

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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines