MDSTk Libraries
1.1.0
Medical Data Segmentation Toolkit
|
Class encapsulates affine tranformation matrix. More...
#include <mdsAffineMatrix.h>
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 | |
CStaticMatrix & | abs () |
Makes absolute value of all elements. | |
CAffineMatrix & | addRotate (tCoordinate Angle) |
Adds a rotation matrix to the current one. | |
CAffineMatrix & | addScale (tCoordinate sx, tCoordinate sy) |
Adds a scaling matrix to the current one using multiplication. | |
CAffineMatrix & | addScale (const tCoords3 &v) |
CAffineMatrix & | addTranslate (tCoordinate dx, tCoordinate dy) |
Adds a the translation matrix to the current one. | |
CAffineMatrix & | addTranslate (const tCoords3 &v) |
tStorage & | asEigen () |
Returns reference to the underlying matrix data (see the Eigen math library). | |
const tStorage & | asEigen () const |
tCoordinate & | at (tSize Row, tSize Col) |
Returns reference to the element [Row][Col]. | |
const tCoordinate & | at (tSize Row, tSize Col) const |
Method returns element (by value) at (row, col). | |
tCoordinate & | at (tSize i) |
Returns the subscripted pixel. | |
const tCoordinate & | at (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 |
CStaticMatrix & | fill (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. | |
tCoordinate * | getColPtr (tSize Col) |
Returns pointer to the first element of matrix column. | |
const tCoordinate * | getColPtr (tSize Col) const |
tSize | getIdx (tSize Row, tSize Col) const |
Calculates index of a specified pixel. | |
tMatrix & | getImpl () |
Returns reference to the matrix implementation. | |
const tMatrix & | getImpl () const |
tSize | getNumOfCols () const |
tSize | getNumOfRows () const |
Returns the matrix dimensions. | |
tCoordinate * | getPtr () |
Returns pointer to the first matrix element. | |
const tCoordinate * | getPtr () const |
tCoordinate * | getPtr (tSize Row, tSize Col) |
Returns pointer to the given element. | |
const tCoordinate * | getPtr (tSize Row, tSize Col) const |
tSize | getRowOffset () const |
Returns row offset. | |
tCoordinate * | getRowPtr (tSize Row) |
Returns pointer to the first element of matrix row. | |
const tCoordinate * | getRowPtr (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. | |
CAffineMatrix & | makeIdentity () |
Makes the matrix unit. | |
CAffineMatrix & | makeRotate (tCoordinate Angle) |
Makes the rotation matrix. | |
CAffineMatrix & | makeScale (tCoordinate sx, tCoordinate sy) |
Makes the scaling matrix. | |
CAffineMatrix & | makeScale (const tCoords3 &v) |
CAffineMatrix & | makeTranslate (tCoordinate dx, tCoordinate dy) |
Makes the translation matrix. | |
CAffineMatrix & | makeTranslate (const tCoords3 &v) |
CStaticMatrix & | mult (const CStaticMatrix< tCoordinate, M, K > &Matrix1, const CStaticMatrix< tCoordinate, K, N > &Matrix2) |
Matrix multiplication. | |
CStaticMatrix & | multAdd (const CStaticMatrix &Matrix, const tCoordinate &Scalar) |
Provides operation this += Matrix * Scalar. | |
CStaticMatrix & | ones () |
Sets all elements to one. | |
tCoordinate & | operator() (tSize Row, tSize Col) |
Returns reference to the element [Row][Col]. | |
const tCoordinate & | operator() (tSize Row, tSize Col) const |
Method returns element (by value) at (row, col). | |
tCoordinate & | operator() (tSize i) |
Returns the subscripted pixel. | |
const tCoordinate & | operator() (tSize i) const |
CStaticMatrix & | operator*= (const CStaticMatrix &Matrix) |
Element wise product. | |
CStaticMatrix & | operator*= (const CScalar< U > &c) |
Multiplies all elements by scalar. | |
CStaticMatrix & | operator+= (const CStaticMatrix &Matrix) |
Element wise addition. | |
CStaticMatrix & | operator+= (const CScalar< U > &c) |
Adds scalar to all elements. | |
CStaticMatrix & | operator-= (const CStaticMatrix &Matrix) |
Element wise subtraction. | |
CStaticMatrix & | operator-= (const CScalar< U > &c) |
Subtracts scalar to all elements. | |
CStaticMatrix & | operator/= (const CStaticMatrix &Matrix) |
Element wise addition. | |
CStaticMatrix & | operator/= (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. | |
tMatrix & | set (tSize row, tSize col, const tElement &Value) |
Method sets value of element at (row, col). | |
CStaticMatrix & | set (tSize Row, tSize Col, const tCoordinate &Value) |
Sets the element of matrix at the position [Row][Col]. | |
tMatrix & | set (tSize i, const tElement &Value) |
Sets the subscripted matrix coefficient. | |
CStaticMatrix & | set (tSize i, const tCoordinate &Value) |
Sets the subscripted voxel. | |
CAffineMatrix & | setRotate (tCoordinate Angle) |
Sets the rotation. | |
CAffineMatrix & | setScale (tCoordinate sx, tCoordinate sy) |
Sets the scaling. | |
CAffineMatrix & | setScale (const tCoords3 &v) |
CAffineMatrix & | setTranslate (tCoordinate dx, tCoordinate dy) |
Sets the translation. | |
CAffineMatrix & | setTranslate (const tCoords3 &v) |
CStaticMatrix & | transpose (const CStaticMatrix< tCoordinate, N, M > &Matrix) |
Makes this to be transpose of a given matrix. | |
CStaticMatrix & | unit () |
Makes the matrix unit. | |
CStaticMatrix & | zeros () |
Zeros the matrix. | |
~CAffineMatrix () | |
Destructor. | |
Protected Attributes | |
tStorage | m_Matrix |
Underlying matrix data (see the Eigen math library). |
Class encapsulates affine tranformation matrix.
typedef CMatrixBase<CStaticMatrix<tCoordinate , M, N> > mds::math::CStaticMatrix< tCoordinate , M, N >::tBase [inherited] |
Base class.
Vector of coordinates.
typedef tCoordinate mds::math::CStaticMatrix< tCoordinate , M, N >::tElement [inherited] |
Matrix element type.
Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.
Base class.
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).
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.
Default constructor.
mds::img::CAffineMatrix::CAffineMatrix | ( | const mds::math::CStaticMatrix< U, 3, 3 > & | Matrix | ) |
Copy constructor.
CAffineMatrix::CAffineMatrix | ( | const CAffineMatrix & | Matrix | ) |
Copy constructor specialization.
Destructor.
mds::img::CAffineMatrix::CAffineMatrix | ( | const mds::math::CStaticMatrix< U, 3, 3 > & | Matrix | ) |
CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::abs | ( | ) | [inherited] |
Makes absolute value of all elements.
CAffineMatrix & CAffineMatrix::addRotate | ( | tCoordinate | Angle | ) |
Adds a rotation matrix to the current one.
CAffineMatrix & CAffineMatrix::addScale | ( | tCoordinate | sx, |
tCoordinate | sy | ||
) |
Adds a scaling matrix to the current one using multiplication.
CAffineMatrix & CAffineMatrix::addScale | ( | const tCoords3 & | v | ) |
CAffineMatrix & CAffineMatrix::addTranslate | ( | tCoordinate | dx, |
tCoordinate | dy | ||
) |
Adds a the translation matrix to the current one.
CAffineMatrix & CAffineMatrix::addTranslate | ( | const tCoords3 & | v | ) |
tStorage& mds::math::CStaticMatrix< tCoordinate , M, N >::asEigen | ( | ) | [inherited] |
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] |
Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.
tSize mds::math::CStaticMatrix< tCoordinate , M, N >::cols | ( | ) | const [inherited] |
Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.
CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::fill | ( | const tCoordinate & | Value | ) | [inherited] |
Fills the matrix using a given value.
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 > >.
tCoordinate * mds::math::CStaticMatrix< tCoordinate , M, N >::getColPtr | ( | tSize | Col | ) | [inherited] |
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 > >.
tMatrix& mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >::getImpl | ( | ) | [inherited] |
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] |
Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.
tSize mds::math::CStaticMatrix< tCoordinate , M, N >::getNumOfRows | ( | ) | const [inherited] |
Returns the matrix dimensions.
Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.
tCoordinate * mds::math::CStaticMatrix< tCoordinate , M, N >::getPtr | ( | ) | [inherited] |
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 > >.
tCoordinate * mds::math::CStaticMatrix< tCoordinate , M, N >::getRowPtr | ( | tSize | Row | ) | [inherited] |
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.
void CAffineMatrix::invert | ( | ) |
Inverts the transformation matrix inplace.
bool mds::math::CStaticMatrix< tCoordinate , M, N >::isSquare | ( | ) | const [inherited] |
Returns true of the matrix is square.
Makes the matrix unit.
CAffineMatrix & CAffineMatrix::makeRotate | ( | tCoordinate | Angle | ) |
Makes the rotation matrix.
CAffineMatrix & CAffineMatrix::makeScale | ( | tCoordinate | sx, |
tCoordinate | sy | ||
) |
Makes the scaling matrix.
CAffineMatrix & CAffineMatrix::makeScale | ( | const tCoords3 & | v | ) |
CAffineMatrix & CAffineMatrix::makeTranslate | ( | tCoordinate | dx, |
tCoordinate | dy | ||
) |
Makes the translation matrix.
CAffineMatrix & CAffineMatrix::makeTranslate | ( | const tCoords3 & | v | ) |
CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::mult | ( | const CStaticMatrix< tCoordinate , M, K > & | Matrix1, |
const CStaticMatrix< tCoordinate , K, N > & | Matrix2 | ||
) | [inherited] |
Matrix multiplication.
CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::multAdd | ( | const CStaticMatrix< tCoordinate, 3, 3 > & | Matrix, |
const tCoordinate & | Scalar | ||
) | [inherited] |
Provides operation this += Matrix * Scalar.
CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::ones | ( | ) | [inherited] |
Sets all elements to one.
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] |
Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.
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.
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.
Reimplemented from mds::math::CMatrixBase< CStaticMatrix< tCoordinate, M, N > >.
void CAffineMatrix::postMult | ( | const CAffineMatrix & | m | ) |
Inplace matrix multiplication.
CAffineMatrix::tCoords3 mds::img::CAffineMatrix::preMult | ( | const tCoords3 & | v | ) | const |
Multiplies the matrix and a given vector.
void mds::img::CAffineMatrix::preMult | ( | const tCoords3 & | v, |
tCoords3 & | r | ||
) | const |
Multiplication of the matrix and a given vector.
void CAffineMatrix::preMult2 | ( | tCoords3 & | v | ) | const |
Inplace multiplication of the matrix and a given vector.
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.
CAffineMatrix & CAffineMatrix::setRotate | ( | tCoordinate | Angle | ) |
Sets the rotation.
CAffineMatrix & CAffineMatrix::setScale | ( | tCoordinate | sx, |
tCoordinate | sy | ||
) |
Sets the scaling.
CAffineMatrix & CAffineMatrix::setScale | ( | const tCoords3 & | v | ) |
CAffineMatrix & CAffineMatrix::setTranslate | ( | tCoordinate | dx, |
tCoordinate | dy | ||
) |
Sets the translation.
CAffineMatrix & CAffineMatrix::setTranslate | ( | const tCoords3 & | v | ) |
CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::transpose | ( | const CStaticMatrix< tCoordinate , N, M > & | Matrix | ) | [inherited] |
Makes this to be transpose of a given matrix.
CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::unit | ( | ) | [inherited] |
Makes the matrix unit.
CStaticMatrix& mds::math::CStaticMatrix< tCoordinate , M, N >::zeros | ( | ) | [inherited] |
Zeros the matrix.
tStorage mds::math::CStaticMatrix< tCoordinate , M, N >::m_Matrix [protected, inherited] |
Underlying matrix data (see the Eigen math library).