Difference between revisions of "NAMIC Wiki:DTI:ITK"
From NAMIC Wiki
m (Update from Wiki) |
m (Update from Wiki) |
||
Line 1: | Line 1: | ||
− | Header for proposed | + | Header for proposed itkSymmetricTensorTraits. |
<nowiki> | <nowiki> | ||
Line 5: | Line 5: | ||
Program: Insight Segmentation & Registration Toolkit | Program: Insight Segmentation & Registration Toolkit | ||
− | Module: $RCSfile: | + | Module: $RCSfile: itkSymmetricTensorTraits.h,v $ |
Language: C++ | Language: C++ | ||
− | Date: $Date | + | Date: $Date$ |
− | Version: $Revision | + | Version: $Revision$ |
Copyright (c) Insight Software Consortium. All rights reserved. | Copyright (c) Insight Software Consortium. All rights reserved. | ||
Line 19: | Line 19: | ||
=========================================================================*/ | =========================================================================*/ | ||
− | #ifndef | + | #ifndef __itkSymmetricTensorTraits_h |
− | #define | + | #define __itkSymmetricTensorTraits_h |
#include "itkFixedArray.h" | #include "itkFixedArray.h" | ||
− | |||
− | |||
namespace itk | namespace itk | ||
{ | { | ||
− | /** \class | + | /** \class itkSymmetricTensorTraits |
* | * | ||
*/ | */ | ||
− | template | + | template<typename TRealType, unsigned int VTensorDimension> |
− | + | class ITK_EXPORT SymmetricTensorTraits | |
− | |||
− | |||
− | class ITK_EXPORT | ||
− | |||
{ | { | ||
− | + | public: | |
− | + | static const unsigned int NTensorDimension = VTensorDimension; | |
static const unsigned int NVectorDimension = | static const unsigned int NVectorDimension = | ||
− | + | VTensorDimension * (VTensorDimension+1) / 2; | |
/** Standard class typedefs. */ | /** Standard class typedefs. */ | ||
− | typedef | + | typedef SymmetricTensorTraits Self; |
− | + | typedef FixedArray<TRealType,NVectorDimension> SymmetricTensorBaseType; | |
− | |||
− | typedef FixedArray< TRealType, NVectorDimension > | ||
− | / | + | /// Perform eigenvalue computation. |
− | + | static void ComputeEigenvalues( const SymmetricTensorBaseType& tensor, | |
+ | double (&lambda)[VTensorDimension] ); | ||
+ | }; | ||
− | + | /// Specialization for 3D tensors. | |
− | + | template<typename TRealType> | |
− | + | class ITK_EXPORT SymmetricTensorTraits<TRealType,3> | |
+ | { | ||
+ | public: | ||
+ | static const unsigned int NTensorDimension = 3; | ||
+ | static const unsigned int NVectorDimension = 6; | ||
− | + | /** Standard class typedefs. */ | |
− | /* | + | typedef SymmetricTensorTraits Self; |
− | + | typedef FixedArray<TRealType,NVectorDimension> SymmetricTensorBaseType; | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | /// Perform eigenvalue computation. | |
− | void | + | static void ComputeEigenvalues( const SymmetricTensorBaseType& tensor, |
+ | double (&lambda)[3] ); | ||
}; | }; | ||
Line 108: | Line 66: | ||
#ifndef ITK_MANUAL_INSTANTIATION | #ifndef ITK_MANUAL_INSTANTIATION | ||
− | #include " | + | #include "itkSymmetricTensorTraits.txx" |
#endif | #endif | ||
Revision as of 14:06, 18 December 2006
Home < NAMIC Wiki:DTI:ITKHeader for proposed itkSymmetricTensorTraits.
/*========================================================================= Program: Insight Segmentation & Registration Toolkit Module: $RCSfile: itkSymmetricTensorTraits.h,v $ Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) Insight Software Consortium. All rights reserved. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef __itkSymmetricTensorTraits_h #define __itkSymmetricTensorTraits_h #include "itkFixedArray.h" namespace itk { /** \class itkSymmetricTensorTraits * */ template<typename TRealType, unsigned int VTensorDimension> class ITK_EXPORT SymmetricTensorTraits { public: static const unsigned int NTensorDimension = VTensorDimension; static const unsigned int NVectorDimension = VTensorDimension * (VTensorDimension+1) / 2; /** Standard class typedefs. */ typedef SymmetricTensorTraits Self; typedef FixedArray<TRealType,NVectorDimension> SymmetricTensorBaseType; /// Perform eigenvalue computation. static void ComputeEigenvalues( const SymmetricTensorBaseType& tensor, double (&lambda)[VTensorDimension] ); }; /// Specialization for 3D tensors. template<typename TRealType> class ITK_EXPORT SymmetricTensorTraits<TRealType,3> { public: static const unsigned int NTensorDimension = 3; static const unsigned int NVectorDimension = 6; /** Standard class typedefs. */ typedef SymmetricTensorTraits Self; typedef FixedArray<TRealType,NVectorDimension> SymmetricTensorBaseType; /// Perform eigenvalue computation. static void ComputeEigenvalues( const SymmetricTensorBaseType& tensor, double (&lambda)[3] ); }; } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkSymmetricTensorTraits.txx" #endif #endif