Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::Matrix< T, NRows, NColumns > Class Template Reference

MITK matrix type extending itk::Matrix with additional constructors and utility methods. More...

#include <mitkMatrix.h>

Inheritance diagram for mitk::Matrix< T, NRows, NColumns >:
Collaboration diagram for mitk::Matrix< T, NRows, NColumns >:

Public Types

typedef Matrix Self
 Standard class typedefs. More...
 
typedef itk::Matrix< T, NRows, NColumns >::InternalMatrixType InternalMatrixType
 

Public Member Functions

 Matrix ()
 Default constructor. More...
 
 Matrix (const Matrix &matrix)
 Copy constructor. More...
 
 Matrix (const itk::Matrix< T, NRows, NColumns > &matrix)
 Copy constructor for itk compatibility. More...
 
 Matrix (const vnl_matrix< T > &matrix)
 Constructor from vnl_matrix. More...
 
 Matrix (InternalMatrixType &matrix)
 Constructor from internal matrix type. More...
 
template<typename ArrayType >
void FillMatrix (const ArrayType &array)
 Copy elements from a 2D array into this matrix. More...
 
template<typename MatrixType >
void ToArray (MatrixType matrix) const
 Copy the elements of this matrix into a 2D array. More...
 

Detailed Description

template<class T, unsigned int NRows = 3, unsigned int NColumns = 3>
class mitk::Matrix< T, NRows, NColumns >

MITK matrix type extending itk::Matrix with additional constructors and utility methods.

Template Parameters
TElement type (e.g. double, float).
NRowsNumber of rows (default: 3).
NColumnsNumber of columns (default: 3).

Definition at line 31 of file mitkMatrix.h.

Member Typedef Documentation

◆ InternalMatrixType

template<class T , unsigned int NRows = 3, unsigned int NColumns = 3>
typedef itk::Matrix<T, NRows, NColumns>::InternalMatrixType mitk::Matrix< T, NRows, NColumns >::InternalMatrixType

Definition at line 37 of file mitkMatrix.h.

◆ Self

template<class T , unsigned int NRows = 3, unsigned int NColumns = 3>
typedef Matrix mitk::Matrix< T, NRows, NColumns >::Self

Standard class typedefs.

Definition at line 35 of file mitkMatrix.h.

Constructor & Destructor Documentation

◆ Matrix() [1/5]

template<class T , unsigned int NRows = 3, unsigned int NColumns = 3>
mitk::Matrix< T, NRows, NColumns >::Matrix ( )
inlineexplicit

Default constructor.

Definition at line 40 of file mitkMatrix.h.

◆ Matrix() [2/5]

template<class T , unsigned int NRows = 3, unsigned int NColumns = 3>
mitk::Matrix< T, NRows, NColumns >::Matrix ( const Matrix< T, NRows, NColumns > &  matrix)
inlineexplicit

Copy constructor.

Definition at line 42 of file mitkMatrix.h.

◆ Matrix() [3/5]

template<class T , unsigned int NRows = 3, unsigned int NColumns = 3>
mitk::Matrix< T, NRows, NColumns >::Matrix ( const itk::Matrix< T, NRows, NColumns > &  matrix)
inline

Copy constructor for itk compatibility.

Definition at line 44 of file mitkMatrix.h.

◆ Matrix() [4/5]

template<class T , unsigned int NRows = 3, unsigned int NColumns = 3>
mitk::Matrix< T, NRows, NColumns >::Matrix ( const vnl_matrix< T > &  matrix)
inline

Constructor from vnl_matrix.

Definition at line 48 of file mitkMatrix.h.

◆ Matrix() [5/5]

template<class T , unsigned int NRows = 3, unsigned int NColumns = 3>
mitk::Matrix< T, NRows, NColumns >::Matrix ( InternalMatrixType &  matrix)
inlineexplicit

Constructor from internal matrix type.

Definition at line 50 of file mitkMatrix.h.

Member Function Documentation

◆ FillMatrix()

template<class T , unsigned int NRows = 3, unsigned int NColumns = 3>
template<typename ArrayType >
void mitk::Matrix< T, NRows, NColumns >::FillMatrix ( const ArrayType &  array)
inline

Copy elements from a 2D array into this matrix.

Note that this method will assign doubles to floats without complaining!

Parameters
[in]arrayThe array whose values shall be copied. Must overload [][] operator.

Definition at line 64 of file mitkMatrix.h.

◆ ToArray()

template<class T , unsigned int NRows = 3, unsigned int NColumns = 3>
template<typename MatrixType >
void mitk::Matrix< T, NRows, NColumns >::ToArray ( MatrixType  matrix) const
inline

Copy the elements of this matrix into a 2D array.

Warning
The target matrix must have the same dimensions as this Matrix.

Definition at line 81 of file mitkMatrix.h.


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