1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Base__Functors__InvertValue__h__
7 #define __fpa__Base__Functors__InvertValue__h__
10 #include <itkFunctionBase.h>
20 template< class _TInputValue, class _TOutputValue >
22 : public itk::FunctionBase< _TInputValue, _TOutputValue >
25 typedef InvertValue Self;
26 typedef itk::FunctionBase< _TInputValue, _TOutputValue > Superclass;
27 typedef itk::SmartPointer< Self > Pointer;
28 typedef itk::SmartPointer< const Self > ConstPointer;
30 typedef _TInputValue TInputValue;
31 typedef _TOutputValue TOutputValue;
35 itkTypeMacro( InvertValue, itk::FunctionBase );
37 itkGetConstMacro( Alpha, double );
38 itkGetConstMacro( Beta, double );
39 itkSetMacro( Alpha, double );
40 itkSetMacro( Beta, double );
43 virtual TOutputValue Evaluate( const TInputValue& a ) const override
45 double d = this->m_Alpha;
46 d += std::pow( double( a ), this->m_Beta );
48 if( std::fabs( d ) > double( 0 ) )
51 ( this->m_Alpha + std::pow( double( a ), this->m_Beta ) );
52 return( TOutputValue( x ) );
58 m_Alpha( double( 1 ) ),
61 virtual ~InvertValue( ) { }
64 InvertValue( const Self& other );
65 Self& operator=( const Self& other );
78 #endif // __fpa__Base__Functors__InvertValue__h__