namespace Dijkstra
{
/**
+ * w_{i,j}=\left(\exp\left(\left(\frac{w_{i}-w_{j}}{\beta}\right)^{2}\right)-1\right)^{\alpha}
*/
template< class _TInputImage, class _TOutputValue >
class Gaussian
fpa::Image::Functors::Dijkstra::Function
);
- public:
- double GetAlpha( ) const
- {
- return( double( 1 ) - this->m_Alpha );
- }
- double GetBeta( ) const
- {
- return( std::sqrt( this->m_Beta ) );
- }
- void SetAlpha( const double& v )
- {
- this->m_Alpha = double( 1 ) - v;
- this->Modified( );
- }
- void SetBeta( const double& v )
- {
- this->m_Beta = v * v;
- this->Modified( );
- }
+ itkGetConstMacro( Alpha, double );
+ itkSetMacro( Alpha, double );
+ itkGetConstMacro( Beta, double );
+ itkSetMacro( Beta, double );
+
+ public:
virtual _TOutputValue Evaluate(
const TVertex& v, const TVertex& p
) const override
{
double d = double( this->m_Image->GetPixel( v ) );
d -= double( this->m_Image->GetPixel( p ) );
- d = ( d * d ) / this->m_Beta;
- return(
- _TOutputValue( double( 1 ) - ( this->m_Alpha * std::exp( -d ) ) )
- );
+ d /= this->m_Beta;
+ d = std::exp( d * d ) - double( 1 );
+ return( _TOutputValue( std::pow( d, this->m_Alpha ) ) );
}
protected: