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 __itkEdgePotentialImageFilter_h
00018 #define __itkEdgePotentialImageFilter_h
00019
00020 #include "itkUnaryFunctorImageFilter.h"
00021
00022 namespace itk
00023 {
00024
00036 namespace Functor {
00037
00038 template< class TInput, class TOutput>
00039 class EdgePotential
00040 {
00041 public:
00042 EdgePotential() {};
00043 ~EdgePotential() {};
00044 bool operator!=( const EdgePotential & ) const
00045 {
00046 return false;
00047 }
00048 bool operator==( const EdgePotential & other ) const
00049 {
00050 return !(*this != other);
00051 }
00052 inline TOutput operator()( const TInput & A ) const
00053 {
00054 return static_cast<TOutput>( vcl_exp(-1.0 * A.GetNorm() ) );
00055 }
00056 };
00057 }
00058
00059 template <class TInputImage, class TOutputImage>
00060 class ITK_EXPORT EdgePotentialImageFilter :
00061 public
00062 UnaryFunctorImageFilter<TInputImage,TOutputImage,
00063 Functor::EdgePotential<
00064 typename TInputImage::PixelType,
00065 typename TOutputImage::PixelType> >
00066 {
00067 public:
00069 typedef EdgePotentialImageFilter Self;
00070 typedef UnaryFunctorImageFilter<TInputImage,TOutputImage,
00071 Functor::EdgePotential<
00072 typename TInputImage::PixelType,
00073 typename TOutputImage::PixelType>
00074 > Superclass;
00075 typedef SmartPointer<Self> Pointer;
00076 typedef SmartPointer<const Self> ConstPointer;
00077
00079 itkNewMacro(Self);
00080
00082 itkTypeMacro(EdgePotentialImageFilter,
00083 UnaryFunctorImageFilter);
00084
00085 #ifdef ITK_USE_CONCEPT_CHECKING
00086
00087 itkConceptMacro(InputHasNumericTraitsCheck,
00088 (Concept::HasNumericTraits<typename TInputImage::PixelType::ValueType>));
00089
00091 #endif
00092
00093 protected:
00094 EdgePotentialImageFilter() {}
00095 virtual ~EdgePotentialImageFilter() {}
00096
00097 private:
00098 EdgePotentialImageFilter(const Self&);
00099 void operator=(const Self&);
00100
00101 };
00102
00103
00104 }
00105
00106
00107 #endif
00108