00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkDiffusionTensor3D.h,v $ 00005 Language: C++ 00006 Date: $Date: 2005/08/24 17:32:41 $ 00007 Version: $Revision: 1.8 $ 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 && __GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ == 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 Self& r); 00105 DiffusionTensor3D(const Superclass& r); 00106 DiffusionTensor3D(const ComponentType& r); 00107 DiffusionTensor3D(const ComponentArrayType r); 00108 00110 Self& operator= (const Self& r); 00111 Self& operator= (const Superclass & r); 00112 Self& operator= (const ComponentType& r); 00113 Self& operator= (const ComponentArrayType r); 00114 00116 AccumulateValueType GetTrace() const; 00117 00119 RealValueType GetFractionalAnisotropy() const; 00120 00122 RealValueType GetRelativeAnisotropy() const; 00123 00125 RealValueType GetInnerScalarProduct() const; 00126 00127 }; 00128 00129 } // end namespace itk 00130 00131 #ifndef ITK_MANUAL_INSTANTIATION 00132 #include "itkDiffusionTensor3D.txx" 00133 #endif 00134 00135 #endif