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 inline TOutput operator()( const TInput & A )
00054 {
00055 return (TOutput)vcl_exp((double)A);
00056 }
00057 };
00058 }
00059 template <class TInputImage, class TOutputImage>
00060 class ITK_EXPORT ExpImageFilter :
00061 public
00062 UnaryFunctorImageFilter<TInputImage,TOutputImage,
00063 Function::Exp<
00064 typename TInputImage::PixelType,
00065 typename TOutputImage::PixelType> >
00066 {
00067 public:
00069 typedef ExpImageFilter Self;
00070 typedef UnaryFunctorImageFilter<TInputImage,TOutputImage,
00071 Function::Exp< typename TInputImage::PixelType,
00072 typename TOutputImage::PixelType> > Superclass;
00073 typedef SmartPointer<Self> Pointer;
00074 typedef SmartPointer<const Self> ConstPointer;
00075
00077 itkNewMacro(Self);
00078
00079 #ifdef ITK_USE_CONCEPT_CHECKING
00080
00081 itkConceptMacro(InputConvertibleToDoubleCheck,
00082 (Concept::Convertible<typename TInputImage::PixelType, double>));
00083 itkConceptMacro(DoubleConvertibleToOutputCheck,
00084 (Concept::Convertible<double, typename TOutputImage::PixelType>));
00085
00087 #endif
00088
00089 protected:
00090 ExpImageFilter() {}
00091 virtual ~ExpImageFilter() {}
00092
00093 private:
00094 ExpImageFilter(const Self&);
00095 void operator=(const Self&);
00096
00097
00098 };
00099
00100 }
00101
00102
00103 #endif
00104