00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkDiffusionTensor3D.h,v $ 00005 Language: C++ 00006 Date: $Date: 2010-04-09 21:20:50 $ 00007 Version: $Revision: 1.14 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __itkDiffusionTensor3D_h 00018 #define __itkDiffusionTensor3D_h 00019 00020 // Undefine an eventual DiffusionTensor3D macro 00021 #ifdef DiffusionTensor3D 00022 #undef DiffusionTensor3D 00023 #endif 00024 00025 #include "itkSymmetricSecondRankTensor.h" 00026 00027 00028 namespace itk 00029 { 00030 00078 template < typename TComponent > 00079 class DiffusionTensor3D: public SymmetricSecondRankTensor<TComponent,3> 00080 { 00081 public: 00083 typedef DiffusionTensor3D Self; 00084 typedef SymmetricSecondRankTensor<TComponent, 3> Superclass; 00085 00087 typedef typename Superclass::ValueType ValueType; 00088 typedef typename Superclass::ComponentType ComponentType; 00089 #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && (__GNUC__ == 3) 00090 typedef ComponentType ComponentArrayType[6]; 00091 #else 00092 typedef typename Superclass::ComponentArrayType ComponentArrayType; 00093 #endif 00094 typedef typename Superclass::AccumulateValueType AccumulateValueType; 00095 typedef typename Superclass::RealValueType RealValueType; 00096 00097 typedef typename Superclass::EigenValuesArrayType EigenValuesArrayType; 00098 typedef typename Superclass::EigenVectorsMatrixType EigenVectorsMatrixType; 00099 00101 DiffusionTensor3D(); 00102 00104 DiffusionTensor3D(const Superclass& r); 00105 DiffusionTensor3D(const ComponentType& r); 00106 DiffusionTensor3D(const ComponentArrayType r); 00108 00110 template < typename TCoordRepB > 00111 DiffusionTensor3D( const DiffusionTensor3D<TCoordRepB> & pa ) 00112 :SymmetricSecondRankTensor<TComponent,3>(pa) { } 00113 00115 Self& operator= (const Superclass & r); 00116 Self& operator= (const ComponentType& r); 00117 Self& operator= (const ComponentArrayType r); 00119 00121 template < typename TCoordRepB > 00122 Self& operator= ( const DiffusionTensor3D<TCoordRepB> & pa ) 00123 { 00124 SymmetricSecondRankTensor<TComponent,3>::operator=(pa); 00125 return *this; 00126 } 00128 00130 AccumulateValueType GetTrace() const; 00131 00133 RealValueType GetFractionalAnisotropy() const; 00134 00136 RealValueType GetRelativeAnisotropy() const; 00137 00139 RealValueType GetInnerScalarProduct() const; 00140 00141 }; 00142 00143 } // end namespace itk 00144 #include "itkNumericTraitsDiffusionTensor3DPixel.h" 00145 00146 // Define instantiation macro for this template. 00147 #define ITK_TEMPLATE_DiffusionTensor3D(_, EXPORT, x, y) namespace itk { \ 00148 _(1(class EXPORT DiffusionTensor3D< ITK_TEMPLATE_1 x >)) \ 00149 namespace Templates { typedef DiffusionTensor3D< ITK_TEMPLATE_1 x > \ 00150 DiffusionTensor3D##y; } \ 00151 } 00152 00153 #if ITK_TEMPLATE_EXPLICIT 00154 # include "Templates/itkDiffusionTensor3D+-.h" 00155 #endif 00156 00157 #if ITK_TEMPLATE_TXX 00158 # include "itkDiffusionTensor3D.txx" 00159 #endif 00160 00161 #endif 00162