ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkSymmetricEigenSystem.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkSymmetricEigenSystem_h
00019 #define __itkSymmetricEigenSystem_h
00020 
00021 #include "itkObject.h"
00022 #include "vnl/algo/vnl_symmetric_eigensystem.h"
00023 #include "itkObjectFactory.h"
00024 #include "itkObject.h"
00025 #include "itkFixedArray.h"
00026 #include "itkMatrix.h"
00027 #include "itkObjectFactory.h"
00028 
00029 namespace itk
00030 {
00046 template< class TMatrixElement, int VNumberOfRows >
00047 class ITK_EXPORT SymmetricEigenSystem:public Object
00048 {
00049 public:
00051   typedef SymmetricEigenSystem       Self;
00052   typedef Object                     Superclass;
00053   typedef SmartPointer< Self >       Pointer;
00054   typedef SmartPointer< const Self > ConstPointer;
00055 
00057   itkTypeMacro(SymmetricEigenSystem, Object);
00058 
00060   itkNewMacro(Self);
00061 
00063   typedef FixedArray< TMatrixElement, VNumberOfRows > ArrayType;
00064 
00066   typedef FixedArray< ArrayType, VNumberOfRows > Array2DType;
00067 
00069   typedef Array2DType EigenVectorArrayType;
00070 
00072   typedef ArrayType EigenValueArrayType;
00073 
00075   typedef Matrix< TMatrixElement, VNumberOfRows, VNumberOfRows > MatrixType;
00076 
00078   typedef vnl_symmetric_eigensystem< TMatrixElement > InternalEigenSystemType;
00079 
00081   itkSetObjectMacro(Matrix, MatrixType);
00082   MatrixType * GetMatrix()
00083   { return m_Matrix; }
00085 
00092   itkSetMacro(UseAbsoluteOrder, bool);
00093   itkGetMacro(UseAbsoluteOrder, bool);
00095 
00097   EigenVectorArrayType * GetEigenVectors()
00098   { return &m_EigenVectors; }
00099 
00101   EigenValueArrayType * GetEigenValues()
00102   { return &m_EigenValues; }
00103 
00106   void Update()
00107   { this->GenerateData(); }
00108 protected:
00109   SymmetricEigenSystem();
00110   virtual ~SymmetricEigenSystem();
00111   void PrintSelf(std::ostream & os, Indent indent) const;
00113 
00115   void GenerateData();
00116 
00117 private:
00118   SymmetricEigenSystem(const Self &); //purposely not implemented
00119   void operator=(const Self &);       //purposely not implemented
00120 
00122   MatrixType *m_Matrix;
00123 
00125   EigenVectorArrayType m_EigenVectors;
00126 
00128   EigenValueArrayType m_EigenValues;
00129 
00132   bool m_UseAbsoluteOrder;
00133 };
00134 } // end namespace itk
00135 
00136 #ifndef ITK_MANUAL_INSTANTIATION
00137 #include "itkSymmetricEigenSystem.hxx"
00138 #endif
00139 
00140 #endif
00141