Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkNumericTraitsDiffusionTensor3DPixel.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkNumericTraitsDiffusionTensor3DPixel.h,v $
00005   Language:  C++
00006   Date:      $Date: 2010-04-09 21:21:37 $
00007   Version:   $Revision: 1.3 $
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 __itkNumericTraitsDiffusionTensor3DPixel_h
00018 #define __itkNumericTraitsDiffusionTensor3DPixel_h
00019 
00020 #include "itkNumericTraitsFixedArrayPixel.h"
00021 #include "itkDiffusionTensor3D.h"
00022 
00023 // This file is meant to define numeric traits for tensor pixels types in itk
00024 
00025 namespace itk
00026 {
00027 
00028 //
00029 // First we define a macro that can be customized to be used for a sequence of
00030 // specializations or for a generic template instantiation. This Macro covers
00031 // the implementation for both partial specialization and total
00032 // specializaion by defining certain macros.
00033 //
00034 #ifdef ITK_USE_NUMERIC_TRAITS_PARTIAL_SPECIALIZATION
00035 
00036 #define itkNumericTraitsDiffusionTensor3DMacro(GENERIC_ARRAY, T)        \
00037   template < typename T >                                               \
00038   class NumericTraits<GENERIC_ARRAY< T > >                              \
00039   {                                                                     \
00040   private:                                                              \
00041                                                                         \
00042     typedef typename NumericTraits<T>::AbsType        ElementAbsType; \
00043     typedef typename NumericTraits<T>::AccumulateType ElementAccumulateType; \
00044     typedef typename NumericTraits<T>::FloatType      ElementFloatType; \
00045     typedef typename NumericTraits<T>::PrintType      ElementPrintType; \
00046     typedef typename NumericTraits<T>::RealType       ElementRealType; \
00047                                                                         \
00048   public:                                                               \
00049                                                                         \
00050     typedef T                                       ValueType;          \
00051     typedef GENERIC_ARRAY<T>                        Self;               \
00052                                                                         \
00053     typedef GENERIC_ARRAY<ElementAbsType>           AbsType;            \
00054     typedef GENERIC_ARRAY<ElementAccumulateType>    AccumulateType;     \
00055     typedef GENERIC_ARRAY<ElementFloatType>         FloatType;          \
00056     typedef GENERIC_ARRAY<ElementPrintType>         PrintType;          \
00057     typedef GENERIC_ARRAY<ElementRealType>          RealType;           \
00058                                                                         \
00059     typedef ElementRealType                         ScalarRealType;     \
00060                                                                         \
00061     static const Self max()                                             \
00062     {                                                                   \
00063       return Self( NumericTraits< T >::max() );                         \
00064     }                                                                   \
00065     static const Self min()                                             \
00066     {                                                                   \
00067       return Self( NumericTraits< T >::min() );                         \
00068     }                                                                   \
00069     static const Self NonpositiveMin()                                  \
00070     {                                                                   \
00071       return Self( NumericTraits< T >::NonpositiveMin() );              \
00072     }                                                                   \
00073     static const Self ZeroValue()                                       \
00074     {                                                                   \
00075       return Self( NumericTraits<T>::ZeroValue() );                     \
00076     }                                                                   \
00077     static const Self OneValue()                                        \
00078     {                                                                   \
00079       return Self( NumericTraits<T>::OneValue() );                      \
00080     }                                                                   \
00081     static const Self ITKCommon_EXPORT Zero;                            \
00082     static const Self ITKCommon_EXPORT One;                             \
00083 };
00084 
00085 
00086 itkNumericTraitsDiffusionTensor3DMacro(DiffusionTensor3D, T)
00087 
00088 #else // ITK_USE_NUMERIC_TRAITS_PARTIAL_SPECIALIZATION
00089 
00090 #define itkNumericTraitsDiffusionTensor3DMacro(GENERIC_ARRAY, T)        \
00091 template< >                                                             \
00092   class NumericTraits<GENERIC_ARRAY< T > >                              \
00093   {                                                                     \
00094   private:                                                              \
00095                                                                         \
00096     typedef  NumericTraits<T>::AbsType        ElementAbsType; \
00097     typedef  NumericTraits<T>::AccumulateType ElementAccumulateType; \
00098     typedef  NumericTraits<T>::FloatType      ElementFloatType; \
00099     typedef  NumericTraits<T>::PrintType      ElementPrintType; \
00100     typedef  NumericTraits<T>::RealType       ElementRealType; \
00101                                                                         \
00102   public:                                                               \
00103                                                                         \
00104     typedef T                                       ValueType;          \
00105     typedef GENERIC_ARRAY<T>                        Self;               \
00106                                                                         \
00107     typedef GENERIC_ARRAY<ElementAbsType>           AbsType;            \
00108     typedef GENERIC_ARRAY<ElementAccumulateType>    AccumulateType;     \
00109     typedef GENERIC_ARRAY<ElementFloatType>         FloatType;          \
00110     typedef GENERIC_ARRAY<ElementPrintType>         PrintType;          \
00111     typedef GENERIC_ARRAY<ElementRealType>          RealType;           \
00112                                                                         \
00113     typedef ElementRealType                         ScalarRealType;     \
00114                                                                         \
00115     static const Self max()                                             \
00116     {                                                                   \
00117       return Self( NumericTraits< T >::max() );                         \
00118     }                                                                   \
00119     static const Self min()                                             \
00120     {                                                                   \
00121       return Self( NumericTraits< T >::min() );                         \
00122     }                                                                   \
00123     static const Self NonpositiveMin()                                  \
00124     {                                                                   \
00125       return Self( NumericTraits< T >::NonpositiveMin() );              \
00126     }                                                                   \
00127     static const Self ZeroValue()                                       \
00128     {                                                                   \
00129       return Self( NumericTraits<T>::ZeroValue() );                     \
00130     }                                                                   \
00131     static const Self OneValue()                                        \
00132     {                                                                   \
00133       return Self( NumericTraits<T>::OneValue() );                      \
00134     }                                                                   \
00135     static const Self ITKCommon_EXPORT Zero;                            \
00136     static const Self ITKCommon_EXPORT One;                             \
00137 };
00138 
00139 itkNumericTraitsDiffusionTensor3DMacro( DiffusionTensor3D, char );
00140 itkNumericTraitsDiffusionTensor3DMacro( DiffusionTensor3D, unsigned char );
00141 itkNumericTraitsDiffusionTensor3DMacro( DiffusionTensor3D, signed char );
00142 itkNumericTraitsDiffusionTensor3DMacro( DiffusionTensor3D, short );
00143 itkNumericTraitsDiffusionTensor3DMacro( DiffusionTensor3D, unsigned short );
00144 itkNumericTraitsDiffusionTensor3DMacro( DiffusionTensor3D, int );
00145 itkNumericTraitsDiffusionTensor3DMacro( DiffusionTensor3D, unsigned int );
00146 itkNumericTraitsDiffusionTensor3DMacro( DiffusionTensor3D, long );
00147 itkNumericTraitsDiffusionTensor3DMacro( DiffusionTensor3D, unsigned long );
00148 itkNumericTraitsDiffusionTensor3DMacro( DiffusionTensor3D, float );
00149 itkNumericTraitsDiffusionTensor3DMacro( DiffusionTensor3D, double );
00150 itkNumericTraitsDiffusionTensor3DMacro( DiffusionTensor3D, long double );
00151 #ifdef ITK_TYPE_USE_LONG_LONG
00152 itkNumericTraitsDiffusionTensor3DMacro( DiffusionTensor3D, long long );
00153 itkNumericTraitsDiffusionTensor3DMacro( DiffusionTensor3D, unsigned long long );
00154 #endif // ITK_TYPE_USE_LONG_LONG
00155 
00156 #endif // ITK_USE_NUMERIC_TRAITS_PARTIAL_SPECIALIZATION
00157 
00158 } // end namespace itk
00159 
00160 #endif // __itkNumericTraitsTensorPixel_h  
00161 

Generated at Mon Jul 12 2010 19:20:02 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000