NAMIC Wiki:DTI:ITK-SymmetricTensorTraits::Header
From NAMIC Wiki
Home < NAMIC Wiki:DTI:ITK-SymmetricTensorTraits::Header
Header 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