00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkExpNegativeImageFilter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2002/09/26 19:47:11 $ 00007 Version: $Revision: 1.1 $ 00008 00009 Copyright (c) 2002 Insight 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 __itkExpNegativeImageFilter_h 00018 #define __itkExpNegativeImageFilter_h 00019 00020 #include "itkUnaryFunctorImageFilter.h" 00021 #include "vnl/vnl_math.h" 00022 00023 namespace itk 00024 { 00025 00034 namespace Function { 00035 template< class TInput, class TOutput> 00036 class ExpNegative 00037 { 00038 public: 00039 ExpNegative() {}; 00040 ~ExpNegative() {}; 00041 inline TOutput operator()( const TInput & A ) 00042 { 00043 return static_cast<TOutput>( exp( - static_cast<double>(A) ) ); 00044 } 00045 }; 00046 } 00047 template <class TInputImage, class TOutputImage> 00048 class ITK_EXPORT ExpNegativeImageFilter : 00049 public 00050 UnaryFunctorImageFilter<TInputImage,TOutputImage, 00051 Function::ExpNegative< 00052 typename TInputImage::PixelType, 00053 typename TOutputImage::PixelType> > 00054 { 00055 public: 00057 typedef ExpNegativeImageFilter Self; 00058 typedef UnaryFunctorImageFilter<TInputImage,TOutputImage, 00059 Function::ExpNegative< typename TInputImage::PixelType, 00060 typename TOutputImage::PixelType> > Superclass; 00061 typedef SmartPointer<Self> Pointer; 00062 typedef SmartPointer<const Self> ConstPointer; 00063 00065 itkNewMacro(Self); 00066 00067 protected: 00068 ExpNegativeImageFilter() {} 00069 virtual ~ExpNegativeImageFilter() {} 00070 00071 private: 00072 ExpNegativeImageFilter(const Self&); //purposely not implemented 00073 void operator=(const Self&); //purposely not implemented 00074 00075 00076 }; 00077 00078 } // end namespace itk 00079 00080 00081 #endif