1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Functors__Dijkstra__Image__Gaussian__h__
6 #define __fpa__Functors__Dijkstra__Image__Gaussian__h__
9 #include <fpa/Functors/BaseVertexFunction.h>
21 template< class _TImage, class _TValue >
23 : public fpa::Functors::BaseVertexFunction< typename _TImage::IndexType, _TValue >
26 typedef _TImage TImage;
27 typedef _TValue TValue;
28 typedef typename TImage::IndexType TVertex;
29 typedef fpa::Functors::BaseVertexFunction< TVertex, TValue > Superclass;
30 typedef Gaussian Self;
31 typedef itk::SmartPointer< Self > Pointer;
32 typedef itk::SmartPointer< const Self > ConstPointer;
37 fpa::Functors::Dijkstra::Image::Gaussian,
38 fpa::Functors::BaseVertexFunction
41 itkGetConstMacro( Alpha, double );
42 itkSetMacro( Alpha, double );
44 itkGetConstMacro( Beta, double );
45 itkSetMacro( Beta, double );
48 virtual TValue Evaluate( const TVertex& v, const TVertex& p ) const override
51 dynamic_cast< const TImage* >(
52 this->m_DataObject.GetPointer( )
56 double d = double( image->GetPixel( v ) );
57 d -= double( image->GetPixel( p ) );
59 d = std::exp( d * d ) - double( 1 );
60 return( TValue( std::pow( d, this->m_Alpha ) ) );
63 return( TValue( -1 ) );
69 m_Alpha( double( 1 ) ),
78 // Purposely not implemented.
79 Gaussian( const Self& other );
80 Self& operator=( const Self& other );
95 #endif // __fpa__Functors__Dijkstra__Gaussian__h__