]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Functors/Dijkstra/Image/Gaussian.h
Merge branch 'sandbox' of ssh://git.creatis.insa-lyon.fr/FrontAlgorithms into sandbox
[FrontAlgorithms.git] / lib / fpa / Functors / Dijkstra / Image / Gaussian.h
index b819f01981b92c9971438c544fe0f577c7b7e3a3..8fa04be63d9b7180bfc0b2d432a6584ffa596754 100644 (file)
@@ -62,9 +62,8 @@ namespace fpa
                 TValue d = TValue( image->GetPixel( v ) );
                 d       -= TValue( image->GetPixel( p ) );
                 d       /= this->m_Beta;
-                d       *= d;
-                if( this->m_TreatAsWeight ) d = std::exp(  d ) - TValue( 1 );
-                else                        d = std::exp( -d );
+                if( this->m_TreatAsWeight ) d = std::exp( d * d ) - TValue( 1 );
+                else                        d = std::exp( -std::fabs( d ) );
 
                 if( d < this->m_Epsilon ) return( this->m_Epsilon );
                 else                      return( d );