1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Functors__Dijkstra__Invert__h__
6 #define __fpa__Functors__Dijkstra__Invert__h__
8 #include <itkFunctionBase.h>
18 template< class _TValue >
20 : public itk::FunctionBase< _TValue, _TValue >
23 typedef _TValue TValue;
24 typedef itk::FunctionBase< _TValue, _TValue > Superclass;
26 typedef itk::SmartPointer< Self > Pointer;
27 typedef itk::SmartPointer< const Self > ConstPointer;
31 itkTypeMacro( fpa::Functors::Dijkstra::Invert, itk::FunctionBase );
33 itkGetConstMacro( Alpha, double );
34 itkSetMacro( Alpha, double );
36 itkGetConstMacro( Beta, double );
37 itkSetMacro( Beta, double );
40 virtual TValue Evaluate( const TValue& v ) const override
42 double a = double( v );
43 double d = this->m_Alpha;
44 d += std::pow( double( a ), this->m_Beta );
46 if( std::fabs( d ) > double( 0 ) )
49 ( this->m_Alpha + std::pow( double( a ), this->m_Beta ) );
50 return( TValue( x ) );
56 m_Alpha( double( 1 ) ),
65 // Purposely not implemented.
66 Invert( const Self& other );
67 Self& operator=( const Self& other );
80 #endif // __fpa__Functors__Dijkstra__Invert__h__