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

itkExpImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkExpImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/11/28 13:36:19 $
00007   Version:   $Revision: 1.23 $
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 __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 )
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<TInputImage,TOutputImage, 
00074                                   Function::Exp< typename TInputImage::PixelType, 
00075                                                  typename TOutputImage::PixelType> >  Superclass;
00076   typedef SmartPointer<Self>   Pointer;
00077   typedef SmartPointer<const Self>  ConstPointer;
00078 
00080   itkNewMacro(Self);
00081 
00083   itkTypeMacro(ExpImageFilter, 
00084                UnaryFunctorImageFilter);
00085 
00086 #ifdef ITK_USE_CONCEPT_CHECKING
00087 
00088   itkConceptMacro(InputConvertibleToDoubleCheck,
00089     (Concept::Convertible<typename TInputImage::PixelType, double>));
00090   itkConceptMacro(DoubleConvertibleToOutputCheck,
00091     (Concept::Convertible<double, typename TOutputImage::PixelType>));
00092 
00094 #endif
00095 
00096 protected:
00097   ExpImageFilter() {}
00098   virtual ~ExpImageFilter() {}
00099 
00100 private:
00101   ExpImageFilter(const Self&); //purposely not implemented
00102   void operator=(const Self&); //purposely not implemented
00103 
00104 
00105 };
00106 #if defined(_MSC_VER) && (_MSC_VER == 1300)
00107 #pragma optimize("",on)
00108 #endif
00109 } // end namespace itk
00110 
00111 
00112 #endif
00113 

Generated at Tue Jul 29 19:53:35 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000