itkExpImageFilter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkExpImageFilter_h
00018 #define __itkExpImageFilter_h
00019
00020 #include "itkUnaryFunctorImageFilter.h"
00021 #include "vnl/vnl_math.h"
00022
00023 #if defined(_MSC_VER) && (_MSC_VER >= 1300)
00024 #pragma function(exp)
00025 #endif
00026
00027 namespace itk
00028 {
00029
00038 namespace Function {
00039 template< class TInput, class TOutput>
00040 class Exp
00041 {
00042 public:
00043 Exp() {};
00044 ~Exp() {};
00045 bool operator!=( const Exp & ) const
00046 {
00047 return false;
00048 }
00049 bool operator==( const Exp & other ) const
00050 {
00051 return !(*this != other);
00052 }
00053 #if defined(_MSC_VER) && (_MSC_VER == 1300)
00054 #pragma optimize("g",off)
00055 #endif
00056 inline TOutput operator()( const TInput & A ) const
00057 {
00058 return (TOutput)vcl_exp((double)A);
00059 }
00060 };
00061 }
00062 template <class TInputImage, class TOutputImage>
00063 class ITK_EXPORT ExpImageFilter :
00064 public
00065 UnaryFunctorImageFilter<TInputImage,TOutputImage,
00066 Function::Exp<
00067 typename TInputImage::PixelType,
00068 typename TOutputImage::PixelType> >
00069 {
00070 public:
00072 typedef ExpImageFilter Self;
00073 typedef UnaryFunctorImageFilter<
00074 TInputImage,TOutputImage,
00075 Function::Exp< typename TInputImage::PixelType,
00076 typename TOutputImage::PixelType> > Superclass;
00077 typedef SmartPointer<Self> Pointer;
00078 typedef SmartPointer<const Self> ConstPointer;
00079
00081 itkNewMacro(Self);
00082
00084 itkTypeMacro(ExpImageFilter,
00085 UnaryFunctorImageFilter);
00086
00087 #ifdef ITK_USE_CONCEPT_CHECKING
00088
00089 itkConceptMacro(InputConvertibleToDoubleCheck,
00090 (Concept::Convertible<typename TInputImage::PixelType, double>));
00091 itkConceptMacro(DoubleConvertibleToOutputCheck,
00092 (Concept::Convertible<double, typename TOutputImage::PixelType>));
00093
00095 #endif
00096
00097 protected:
00098 ExpImageFilter() {}
00099 virtual ~ExpImageFilter() {}
00100
00101 private:
00102 ExpImageFilter(const Self&);
00103 void operator=(const Self&);
00104
00105
00106 };
00107 #if defined(_MSC_VER) && (_MSC_VER == 1300)
00108 #pragma optimize("",on)
00109 #endif
00110 }
00111
00112
00113 #endif
00114