00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkBoundedReciprocalImageFilter_h
00018 #define __itkBoundedReciprocalImageFilter_h
00019
00020 #include "itkUnaryFunctorImageFilter.h"
00021
00022 namespace itk
00023 {
00024
00033 namespace Functor {
00034
00035 template< class TInput, class TOutput>
00036 class BoundedReciprocal
00037 {
00038 public:
00039 BoundedReciprocal() {};
00040 ~BoundedReciprocal() {};
00041 inline TOutput operator()( const TInput & A )
00042 {
00043 return static_cast<TOutput>( 1.0 / ( 1.0 + static_cast<double>(A) ) );
00044 }
00045 };
00046 }
00047
00048 template <class TInputImage, class TOutputImage>
00049 class ITK_EXPORT BoundedReciprocalImageFilter :
00050 public
00051 UnaryFunctorImageFilter<TInputImage,TOutputImage,
00052 Functor::BoundedReciprocal<
00053 typename TInputImage::PixelType,
00054 typename TOutputImage::PixelType> >
00055 {
00056 public:
00058 typedef BoundedReciprocalImageFilter Self;
00059 typedef UnaryFunctorImageFilter<TInputImage,TOutputImage,
00060 Functor::BoundedReciprocal<
00061 typename TInputImage::PixelType,
00062 typename TOutputImage::PixelType>
00063 > Superclass;
00064 typedef SmartPointer<Self> Pointer;
00065 typedef SmartPointer<const Self> ConstPointer;
00066
00068 itkNewMacro(Self);
00069
00070 protected:
00071 BoundedReciprocalImageFilter() {}
00072 virtual ~BoundedReciprocalImageFilter() {}
00073
00074 private:
00075 BoundedReciprocalImageFilter(const Self&);
00076 void operator=(const Self&);
00077
00078 };
00079
00080
00081 }
00082
00083
00084 #endif