ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkDiffusionTensor3D.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 __itkDiffusionTensor3D_h
00019 #define __itkDiffusionTensor3D_h
00020 
00021 // Undefine an eventual DiffusionTensor3D macro
00022 #ifdef DiffusionTensor3D
00023 #undef DiffusionTensor3D
00024 #endif
00025 
00026 #include "itkSymmetricSecondRankTensor.h"
00027 
00028 namespace itk
00029 {
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 
00117   Self & operator=(const ComponentType & r);
00118 
00119   Self & operator=(const ComponentArrayType r);
00120 
00122   template< typename TCoordRepB >
00123   Self & operator=(const DiffusionTensor3D< TCoordRepB > & pa)
00124   {
00125     SymmetricSecondRankTensor< TComponent, 3 >::operator=(pa);
00126     return *this;
00127   }
00129 
00131   AccumulateValueType GetTrace() const;
00132 
00134   RealValueType GetFractionalAnisotropy() const;
00135 
00137   RealValueType GetRelativeAnisotropy() const;
00138 
00140   RealValueType GetInnerScalarProduct() const;
00141 };
00142 } // end namespace itk
00143 #include "itkNumericTraitsDiffusionTensor3DPixel.h"
00144 
00145 // Define instantiation macro for this template.
00146 #define ITK_TEMPLATE_DiffusionTensor3D(_, EXPORT, TypeX, TypeY)     \
00147   namespace itk                                                     \
00148   {                                                                 \
00149   _( 1 ( class EXPORT DiffusionTensor3D< ITK_TEMPLATE_1 TypeX > ) ) \
00150   namespace Templates                                               \
00151   {                                                                 \
00152   typedef DiffusionTensor3D< ITK_TEMPLATE_1 TypeX >                 \
00153   DiffusionTensor3D##TypeY;                                       \
00154   }                                                                 \
00155   }
00156 
00157 #if ITK_TEMPLATE_EXPLICIT
00158 #include "Templates/itkDiffusionTensor3D+-.h"
00159 #endif
00160 
00161 #if ITK_TEMPLATE_TXX
00162 #include "itkDiffusionTensor3D.hxx"
00163 #endif
00164 
00165 #endif
00166