MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Public Types | Public Member Functions | Protected Attributes
mds::img::CAffineMatrix Class Reference

Class encapsulates affine tranformation matrix. More...

#include <mdsAffineMatrix.h>

Inheritance diagram for mds::img::CAffineMatrix:
Inheritance graph
[legend]

List of all members.

Public Types

enum  
 Templates that require members of the CStaticMatrix class can use this enum to check the existence. More...
enum  
 Size of the matrix data. More...
enum  { DIMENSION = 3 }
 Size of the matrix. More...
typedef CMatrixBase
< CStaticMatrix< tCoordinate,
M, N > > 
tBase
 Base class.
typedef CCoordinates3
< tCoordinate
tCoords3
 Vector of coordinates.
typedef tCoordinate tElement
 Matrix element type.
typedef
mds::math::CStaticMatrix
< tCoordinate, 3, 3 > 
tMatrix
 Base class.
typedef Eigen::Matrix
< tElement, M, N,
Eigen::RowMajor > 
tStorage
 Underlying matrix data (see the Eigen math library).

Public Member Functions

CStaticMatrixabs ()
 Makes absolute value of all elements.
CAffineMatrixaddRotate (tCoordinate Angle)
 Adds a rotation matrix to the current one.
CAffineMatrixaddScale (tCoordinate sx, tCoordinate sy)
 Adds a scaling matrix to the current one using multiplication.
CAffineMatrixaddScale (const tCoords3 &v)
CAffineMatrixaddTranslate (tCoordinate dx, tCoordinate dy)
 Adds a the translation matrix to the current one.
CAffineMatrixaddTranslate (const tCoords3 &v)
tStorageasEigen ()
 Returns reference to the underlying matrix data (see the Eigen math library).
const tStorageasEigen () const
tCoordinateat (tSize Row, tSize Col)
 Returns reference to the element [Row][Col].
const tCoordinateat (tSize Row, tSize Col) const
 Method returns element (by value) at (row, col).
tCoordinateat (tSize i)
 Returns the subscripted pixel.
const tCoordinateat (tSize i) const
template<typename U >
 CAffineMatrix (const mds::math::CStaticMatrix< U, 3, 3 > &Matrix)
 CAffineMatrix ()
 Default constructor.
template<typename U >
 CAffineMatrix (const mds::math::CStaticMatrix< U, 3, 3 > &Matrix)
 Copy constructor.
 CAffineMatrix (const CAffineMatrix &Matrix)
 Copy constructor specialization.
tSize cols () const
CStaticMatrixfill (const tCoordinate &Value)
 Fills the matrix using a given value.
Function forEach (Function Func)
 Calls a function object for every matrix element.
Function forEach (Function Func) const
 Calls a function object for every matrix element.
tSize getColOffset () const
 Returns column offset.
tCoordinategetColPtr (tSize Col)
 Returns pointer to the first element of matrix column.
const tCoordinategetColPtr (tSize Col) const
tSize getIdx (tSize Row, tSize Col) const
 Calculates index of a specified pixel.
tMatrixgetImpl ()
 Returns reference to the matrix implementation.
const tMatrixgetImpl () const
tSize getNumOfCols () const
tSize getNumOfRows () const
 Returns the matrix dimensions.
tCoordinategetPtr ()
 Returns pointer to the first matrix element.
const tCoordinategetPtr () const
tCoordinategetPtr (tSize Row, tSize Col)
 Returns pointer to the given element.
const tCoordinategetPtr (tSize Row, tSize Col) const
tSize getRowOffset () const
 Returns row offset.
tCoordinategetRowPtr (tSize Row)
 Returns pointer to the first element of matrix row.
const tCoordinategetRowPtr (tSize Row) const
tCoords3 getScaling () const
 Returns the current scaling ratio.
tCoords3 getTranslation () const
 Returns the current translation.
void invert ()
 Inverts the transformation matrix inplace.
bool isSquare () const
 Returns true of the matrix is square.
CAffineMatrixmakeIdentity ()
 Makes the matrix unit.
CAffineMatrixmakeRotate (tCoordinate Angle)
 Makes the rotation matrix.
CAffineMatrixmakeScale (tCoordinate sx, tCoordinate sy)
 Makes the scaling matrix.
CAffineMatrixmakeScale (const tCoords3 &v)
CAffineMatrixmakeTranslate (tCoordinate dx, tCoordinate dy)
 Makes the translation matrix.
CAffineMatrixmakeTranslate (const tCoords3 &v)
CStaticMatrixmult (const CStaticMatrix< tCoordinate, M, K > &Matrix1, const CStaticMatrix< tCoordinate, K, N > &Matrix2)
 Matrix multiplication.
CStaticMatrixmultAdd (const CStaticMatrix &Matrix, const tCoordinate &Scalar)
 Provides operation this += Matrix * Scalar.
CStaticMatrixones ()
 Sets all elements to one.
tCoordinateoperator() (tSize Row, tSize Col)
 Returns reference to the element [Row][Col].
const tCoordinateoperator() (tSize Row, tSize Col) const
 Method returns element (by value) at (row, col).
tCoordinateoperator() (tSize i)
 Returns the subscripted pixel.
const tCoordinateoperator() (tSize i) const
CStaticMatrixoperator*= (const CStaticMatrix &Matrix)
 Element wise product.
CStaticMatrixoperator*= (const CScalar< U > &c)
 Multiplies all elements by scalar.
CStaticMatrixoperator+= (const CStaticMatrix &Matrix)
 Element wise addition.
CStaticMatrixoperator+= (const CScalar< U > &c)
 Adds scalar to all elements.
CStaticMatrixoperator-= (const CStaticMatrix &Matrix)
 Element wise subtraction.
CStaticMatrixoperator-= (const CScalar< U > &c)
 Subtracts scalar to all elements.
CStaticMatrixoperator/= (const CStaticMatrix &Matrix)
 Element wise addition.
CStaticMatrixoperator/= (const CScalar< U > &c)
 Divides all elements by scalar.
Function pforEach (Function Func)
 Calls a function object for every matrix element.
Function pforEach (Function Func) const
 Calls a function object for every matrix element.
void postMult (const CAffineMatrix &m)
 Inplace matrix multiplication.
tCoords3 preMult (const tCoords3 &v) const
 Multiplies the matrix and a given vector.
void preMult (const tCoords3 &v, tCoords3 &r) const
 Multiplication of the matrix and a given vector.
void preMult2 (tCoords3 &v) const
 Inplace multiplication of the matrix and a given vector.
tSize rows () const
 Returns the matrix dimensions.
tMatrixset (tSize row, tSize col, const tElement &Value)
 Method sets value of element at (row, col).
CStaticMatrixset (tSize Row, tSize Col, const tCoordinate &Value)
 Sets the element of matrix at the position [Row][Col].
tMatrixset (tSize i, const tElement &Value)
 Sets the subscripted matrix coefficient.
CStaticMatrixset (tSize i, const tCoordinate &Value)
 Sets the subscripted voxel.
CAffineMatrixsetRotate (tCoordinate Angle)
 Sets the rotation.
CAffineMatrixsetScale (tCoordinate sx, tCoordinate sy)
 Sets the scaling.
CAffineMatrixsetScale (const tCoords3 &v)
CAffineMatrixsetTranslate (tCoordinate dx, tCoordinate dy)
 Sets the translation.
CAffineMatrixsetTranslate (const tCoords3 &v)
CStaticMatrixtranspose (const CStaticMatrix< tCoordinate, N, M > &Matrix)
 Makes this to be transpose of a given matrix.
CStaticMatrixunit ()
 Makes the matrix unit.
CStaticMatrixzeros ()
 Zeros the matrix.
 ~CAffineMatrix ()
 Destructor.

Protected Attributes

tStorage m_Matrix
 Underlying matrix data (see the Eigen math library).

Detailed Description

Class encapsulates affine tranformation matrix.


Member Typedef Documentation

Base class.

Vector of coordinates.

Matrix element type.

Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.

typedef Eigen::Matrix<tElement, M, N, Eigen::RowMajor> mds::math::CStaticMatrix< tCoordinate , M, N >::tStorage [inherited]

Underlying matrix data (see the Eigen math library).


Member Enumeration Documentation

anonymous enum [inherited]

Templates that require members of the CStaticMatrix class can use this enum to check the existence.

anonymous enum [inherited]

Size of the matrix data.

anonymous enum

Size of the matrix.

Enumerator:
DIMENSION 

Constructor & Destructor Documentation

Default constructor.

  • The matrix remains uninitialized.
template<typename U >
mds::img::CAffineMatrix::CAffineMatrix ( const mds::math::CStaticMatrix< U, 3, 3 > &  Matrix)

Copy constructor.

Copy constructor specialization.

Destructor.

template<typename U >
mds::img::CAffineMatrix::CAffineMatrix ( const mds::math::CStaticMatrix< U, 3, 3 > &  Matrix)

Member Function Documentation

Makes absolute value of all elements.

  • Returns reference to this.

Adds a rotation matrix to the current one.

  • x = x * m

Adds a scaling matrix to the current one using multiplication.

  • x = x * m

Adds a the translation matrix to the current one.

  • x = x * m

Returns reference to the underlying matrix data (see the Eigen math library).

const tStorage& mds::math::CStaticMatrix< tCoordinate , M, N >::asEigen ( ) const [inherited]
tCoordinate & mds::math::CStaticMatrix< tCoordinate , M, N >::at ( tSize  Row,
tSize  Col 
) [inherited]

Returns reference to the element [Row][Col].

Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.

const tCoordinate & mds::math::CStaticMatrix< tCoordinate , M, N >::at ( tSize  row,
tSize  col 
) const [inherited]

Method returns element (by value) at (row, col).

Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.

tCoordinate & mds::math::CStaticMatrix< tCoordinate , M, N >::at ( tSize  i) [inherited]

Returns the subscripted pixel.

Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.

const tCoordinate & mds::math::CStaticMatrix< tCoordinate , M, N >::at ( tSize  i) const [inherited]
tSize mds::math::CStaticMatrix< tCoordinate , M, N >::cols ( ) const [inherited]
CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::fill ( const tCoordinate &  Value) [inherited]

Fills the matrix using a given value.

  • Returns reference to this.
Function mds::math::CStaticMatrix< tCoordinate , M, N >::forEach ( Function  Func) [inherited]

Calls a function object for every matrix element.

Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.

Function mds::math::CStaticMatrix< tCoordinate , M, N >::forEach ( Function  Func) const [inherited]

Calls a function object for every matrix element.

Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.

tSize mds::math::CStaticMatrix< tCoordinate , M, N >::getColOffset ( ) const [inherited]

Returns column offset.

In other words, offset between two neighbouring elements in a matrix row.

Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.

Returns pointer to the first element of matrix column.

const tCoordinate * mds::math::CStaticMatrix< tCoordinate , M, N >::getColPtr ( tSize  Col) const [inherited]
tSize mds::math::CStaticMatrix< tCoordinate , M, N >::getIdx ( tSize  Row,
tSize  Col 
) const [inherited]

Calculates index of a specified pixel.

Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.

Returns reference to the matrix implementation.

const tMatrix& mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >::getImpl ( ) const [inherited]
tSize mds::math::CStaticMatrix< tCoordinate , M, N >::getNumOfCols ( ) const [inherited]
tSize mds::math::CStaticMatrix< tCoordinate , M, N >::getNumOfRows ( ) const [inherited]

Returns the matrix dimensions.

Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.

Returns pointer to the first matrix element.

const tCoordinate * mds::math::CStaticMatrix< tCoordinate , M, N >::getPtr ( ) const [inherited]
tCoordinate * mds::math::CStaticMatrix< tCoordinate , M, N >::getPtr ( tSize  Row,
tSize  Col 
) [inherited]

Returns pointer to the given element.

const tCoordinate * mds::math::CStaticMatrix< tCoordinate , M, N >::getPtr ( tSize  Row,
tSize  Col 
) const [inherited]
tSize mds::math::CStaticMatrix< tCoordinate , M, N >::getRowOffset ( ) const [inherited]

Returns row offset.

In other words, offset between two neighbouring elements in a matrix column.

Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.

Returns pointer to the first element of matrix row.

const tCoordinate * mds::math::CStaticMatrix< tCoordinate , M, N >::getRowPtr ( tSize  Row) const [inherited]

Returns the current scaling ratio.

Returns the current translation.

Inverts the transformation matrix inplace.

  • Throws an exception on failure!
bool mds::math::CStaticMatrix< tCoordinate , M, N >::isSquare ( ) const [inherited]

Returns true of the matrix is square.

Makes the matrix unit.

Makes the rotation matrix.

Makes the scaling matrix.

Makes the translation matrix.

CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::mult ( const CStaticMatrix< tCoordinate , M, K > &  Matrix1,
const CStaticMatrix< tCoordinate , K, N > &  Matrix2 
) [inherited]

Matrix multiplication.

  • Returns reference to this.
CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::multAdd ( const CStaticMatrix< tCoordinate, 3, 3 > &  Matrix,
const tCoordinate &  Scalar 
) [inherited]

Provides operation this += Matrix * Scalar.

  • Returns reference to this.

Sets all elements to one.

  • Returns reference to this.
tCoordinate & mds::math::CStaticMatrix< tCoordinate , M, N >::operator() ( tSize  Row,
tSize  Col 
) [inherited]

Returns reference to the element [Row][Col].

Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.

const tCoordinate & mds::math::CStaticMatrix< tCoordinate , M, N >::operator() ( tSize  row,
tSize  col 
) const [inherited]

Method returns element (by value) at (row, col).

Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.

tCoordinate & mds::math::CStaticMatrix< tCoordinate , M, N >::operator() ( tSize  i) [inherited]

Returns the subscripted pixel.

Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.

const tCoordinate & mds::math::CStaticMatrix< tCoordinate , M, N >::operator() ( tSize  i) const [inherited]
CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::operator*= ( const CStaticMatrix< tCoordinate, 3, 3 > &  Matrix) [inherited]

Element wise product.

CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::operator*= ( const CScalar< U > &  c) [inherited]

Multiplies all elements by scalar.

CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::operator+= ( const CStaticMatrix< tCoordinate, 3, 3 > &  Matrix) [inherited]

Element wise addition.

CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::operator+= ( const CScalar< U > &  c) [inherited]

Adds scalar to all elements.

CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::operator-= ( const CStaticMatrix< tCoordinate, 3, 3 > &  Matrix) [inherited]

Element wise subtraction.

CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::operator-= ( const CScalar< U > &  c) [inherited]

Subtracts scalar to all elements.

CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::operator/= ( const CStaticMatrix< tCoordinate, 3, 3 > &  Matrix) [inherited]

Element wise addition.

CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::operator/= ( const CScalar< U > &  c) [inherited]

Divides all elements by scalar.

Function mds::math::CStaticMatrix< tCoordinate , M, N >::pforEach ( Function  Func) [inherited]

Calls a function object for every matrix element.

  • Parallel version.

Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.

Function mds::math::CStaticMatrix< tCoordinate , M, N >::pforEach ( Function  Func) const [inherited]

Calls a function object for every matrix element.

  • Parallel version.

Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.

Inplace matrix multiplication.

  • x = x * m

Multiplies the matrix and a given vector.

  • Returns v * x
void mds::img::CAffineMatrix::preMult ( const tCoords3 v,
tCoords3 r 
) const

Multiplication of the matrix and a given vector.

  • r = v * x
void CAffineMatrix::preMult2 ( tCoords3 v) const

Inplace multiplication of the matrix and a given vector.

  • v = v * x
tSize mds::math::CStaticMatrix< tCoordinate , M, N >::rows ( ) const [inherited]

Returns the matrix dimensions.

Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.

tMatrix& mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >::set ( tSize  row,
tSize  col,
const tElement Value 
) [inherited]

Method sets value of element at (row, col).

CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::set ( tSize  Row,
tSize  Col,
const tCoordinate &  Value 
) [inherited]

Sets the element of matrix at the position [Row][Col].

tMatrix& mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >::set ( tSize  i,
const tElement Value 
) [inherited]

Sets the subscripted matrix coefficient.

CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::set ( tSize  i,
const tCoordinate &  Value 
) [inherited]

Sets the subscripted voxel.

Sets the rotation.

Sets the scaling.

Sets the translation.

CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::transpose ( const CStaticMatrix< tCoordinate , N, M > &  Matrix) [inherited]

Makes this to be transpose of a given matrix.

  • Returns reference to this.

Makes the matrix unit.

  • Returns reference to this.

Zeros the matrix.

  • Returns reference to this.

Member Data Documentation

tStorage mds::math::CStaticMatrix< tCoordinate , M, N >::m_Matrix [protected, inherited]

Underlying matrix data (see the Eigen math library).


The documentation for this class was generated from the following files: