4 #include <vnl/vnl_matrix.h> 5 #include <vnl/vnl_diag_matrix.h> 7 #include <itkVariableLengthVector.h> 8 #include <itkMatrixOffsetTransformBase.h> 9 #include <itkSymmetricEigenAnalysis.h> 11 #include <vnl/vnl_diag_matrix.h> 12 #include <vnl/vnl_matrix.h> 17 template <
class TScalarType>
31 using
EigenAnalysisType = itk::SymmetricEigenAnalysis < vnl_matrix <
double>, vnl_diag_matrix<
double>, vnl_matrix <
double> >;
33 void GetTensorLogarithm(const vnl_matrix <TScalarType> &tensor, vnl_matrix <TScalarType> &log_tensor);
34 void GetTensorExponential(const vnl_matrix <TScalarType> &tensor, vnl_matrix <TScalarType> &log_tensor);
35 void GetTensorPower(const vnl_matrix <TScalarType> &tensor, vnl_matrix <TScalarType> &outputTensor,
double powerValue);
39 vnl_matrix <TScalarType> m_EigVecs;
40 vnl_diag_matrix <TScalarType> m_EigVals;
44 template <class T1, class T2>
void GetVectorRepresentation(const vnl_matrix <T1> &tensor, itk::VariableLengthVector <T2> &vector,
45 unsigned int vecDim = 0,
bool scale = false);
48 vnl_matrix <T2> &tensor,
unsigned int tensDim = 0,
52 template <class T1, class T2>
53 void RecomposeTensor(vnl_diag_matrix <T1> &eigs, vnl_matrix <T1> &eigVecs, vnl_matrix <T2> &resMatrix);
55 template <class T>
void ProjectOnTensorSpace(const vnl_matrix <T> &matrix, vnl_matrix <T> &tensor);
57 template <typename RealType>
59 vnl_matrix <RealType> &tmpMat);
61 template <typename RealType, typename MatrixType>
63 MatrixType &eigenVectors);
66 template <class T1, class T2, class T3>
67 void RotateSymmetricMatrix(T1 &tensor, T2 &rotationMatrix, T3 &rotated_tensor,
unsigned int tensorDim);
69 template <class T1, class T2>
70 void RotateSymmetricMatrix(vnl_matrix <T1> &tensor, vnl_matrix <T2> &rotationMatrix, vnl_matrix <T2> &rotated_tensor);
72 template <class T1, class T2,
unsigned int NDim>
73 void RotateSymmetricMatrix(itk::Matrix <T1,NDim,NDim> &tensor, itk::Matrix <T2,NDim,NDim> &rotationMatrix,
74 itk::Matrix <T2,NDim,NDim> &rotated_tensor);
76 template <class T1>
double ovlScore(vnl_diag_matrix <T1> &eigsX, vnl_matrix <T1> &eigVecsX,
77 vnl_diag_matrix <T1> &eigsY, vnl_matrix <T1> &eigVecsY);
82 #include "animaBaseTensorTools.hxx" double ovlScore(vnl_diag_matrix< T1 > &eigsX, vnl_matrix< T1 > &eigVecsX, vnl_diag_matrix< T1 > &eigsY, vnl_matrix< T1 > &eigVecsY)
itk::SmartPointer< Self > Pointer
itk::SmartPointer< const Self > ConstPointer
void ExtractRotationFromJacobianMatrix(vnl_matrix< RealType > &jacobianMatrix, vnl_matrix< RealType > &rotationMatrix, vnl_matrix< RealType > &tmpMat)
void GetTensorExponential(const vnl_matrix< TScalarType > &tensor, vnl_matrix< TScalarType > &log_tensor)
void GetVectorRepresentation(const vnl_matrix< T1 > &tensor, itk::VariableLengthVector< T2 > &vector, unsigned int vecDim=0, bool scale=false)
itk::LightObject Superclass
void RotateSymmetricMatrix(T1 &tensor, T2 &rotationMatrix, T3 &rotated_tensor, unsigned int tensorDim)
Rotates a symmetric matrix by performing R^T D R where R is a rotation matrix and D the symmetric mat...
itk::SymmetricEigenAnalysis< vnl_matrix< double >, vnl_diag_matrix< double >, vnl_matrix< double > > EigenAnalysisType
void GetTensorFromVectorRepresentation(const itk::VariableLengthVector< T1 > &vector, vnl_matrix< T2 > &tensor, unsigned int tensDim=0, bool scale=false)
void GetTensorPower(const vnl_matrix< TScalarType > &tensor, vnl_matrix< TScalarType > &outputTensor, double powerValue)
void RecomposeTensor(vnl_diag_matrix< T1 > &eigs, vnl_matrix< T1 > &eigVecs, vnl_matrix< T2 > &resMatrix)
Recompose tensor from values extracted using SymmetricEigenAnalysis (vnl_symmetric_eigensystem transp...
void GetTensorLogarithm(const vnl_matrix< TScalarType > &tensor, vnl_matrix< TScalarType > &log_tensor)
void ProjectOnTensorSpace(const vnl_matrix< T > &matrix, vnl_matrix< T > &tensor)
void ExtractPPDRotationFromJacobianMatrix(vnl_matrix< RealType > &jacobianMatrix, vnl_matrix< RealType > &rotationMatrix, MatrixType &eigenVectors)