]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/Functors/Dijkstra/Gaussian.h
...
[FrontAlgorithms.git] / lib / fpa / Image / Functors / Dijkstra / Gaussian.h
index 5187312b0287008c67a3bae24e2383ea68d25463..d06d84d3084ed8b0c012bf1f1d2a97b42e59ea18 100644 (file)
@@ -18,6 +18,7 @@ namespace fpa
       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
@@ -38,36 +39,22 @@ namespace fpa
             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: