fpa::Image::Functors::VertexParentBase
);
+ itkBooleanMacro( Invert );
itkGetConstMacro( Beta, double );
+ itkGetConstMacro( Invert, bool );
itkSetMacro( Beta, double );
+ itkSetMacro( Invert, bool );
public:
virtual TOutputValue Evaluate(
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 ) ) );
+ d = ( d * d ) / this->m_Beta;
+ if( this->m_Invert )
+ return( TOutputValue( double( 1 ) - std::exp( -d ) ) );
+ else
+ return( TOutputValue( std::exp( -d ) ) );
}
protected:
GaussianWeight( )
: Superclass( ),
+ m_Invert( false ),
m_Beta( double( 1 ) )
{ }
virtual ~GaussianWeight( ) { }
Self& operator=( const Self& other );
protected:
+ bool m_Invert;
double m_Beta;
};