[Insight-users] Calculate eigen values and vectors of a matrix

Andinet Enquobahrie andinet.enqu at kitware.com
Fri Jun 30 11:19:38 EDT 2006


Mafalda Sousa wrote:

> Hello,
>  
> Is there any implemented code by ITK to calculate eigen values and 
> eigen vectors from a matrix (3x3)?

.....
#include "vnl/vnl_math.h"

....

typedef   itk::Matrix< double, 3, 3 >           MatrixType;
typedef   itk::Vector<double, 3 >                VectorType;


MatrixType               eigenVectors;
VectorType               eigenValues;

MatrixType                YourMatrix;

typedef itk::SymmetricEigenAnalysis<
                   MatrixType,
                   VectorType,
                   MatrixType > SymmetricEigenAnalysisType;

SymmetricEigenAnalysisType   symmetricEigenSystem(3);

symmetricEigenSystem.ComputeEigenValuesAndVectors
                     ( YourMatrix, eigenValues, eigenVectors );
......

-Andinet


>  
> Best regards,
> Mafalda
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>  
>




More information about the Insight-users mailing list