// ========================================================================= // @author Leonardo Florez Valencia // @email florez-l@javeriana.edu.co // ========================================================================= #ifndef __fpa__Image__Functors__GaussianWeight__h__ #define __fpa__Image__Functors__GaussianWeight__h__ #include #include namespace fpa { namespace Image { namespace Functors { /** */ template< class _TInputImage, class _TOutputValue > class GaussianWeight : public fpa::Image::Functors::VertexParentBase< _TInputImage, _TOutputValue > { public: typedef _TInputImage TInputImage; typedef _TOutputValue TOutputValue; typedef GaussianWeight Self; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef fpa::Image::Functors::VertexParentBase< TInputImage, TOutputValue > Superclass; typedef typename Superclass::TVertex TVertex; public: itkNewMacro( Self ); itkTypeMacro( fpa::Image::Functors::GaussianWeight, fpa::Image::Functors::VertexParentBase ); itkGetConstMacro( Beta, double ); itkSetMacro( Beta, double ); public: virtual TOutputValue Evaluate( const TVertex& a, const TVertex& p ) const override { double va = double( this->m_Image->GetPixel( a ) ); double vp = double( this->m_Image->GetPixel( p ) ); double d = va - vp; return( TOutputValue( std::exp( -d * d * this->m_Beta ) ) ); } protected: GaussianWeight( ) : Superclass( ), m_Beta( double( 1 ) ) { } virtual ~GaussianWeight( ) { } private: GaussianWeight( const Self& other ); Self& operator=( const Self& other ); protected: double m_Beta; }; } // ecapseman } // ecapseman } // ecapseman #endif // __fpa__Image__Functors__GaussianWeight__h__ // eof - $RCSfile$