1 #ifndef __FPA__BASE__FUNCTORS__INVERTCOSTFUNCTION__H__
2 #define __FPA__BASE__FUNCTORS__INVERTCOSTFUNCTION__H__
5 #include <itkFunctionBase.h>
16 class InvertCostFunction
17 : public itk::FunctionBase< C, C >
20 /// Type-related and pointers
21 typedef InvertCostFunction Self;
22 typedef itk::FunctionBase< C, C > Superclass;
23 typedef itk::SmartPointer< Self > Pointer;
24 typedef itk::SmartPointer< const Self > ConstPointer;
28 itkTypeMacro( InvertCostFunction, itkFunctionBase );
30 itkGetConstMacro( Alpha, C );
31 itkGetConstMacro( Beta, C );
33 itkSetMacro( Alpha, C );
34 itkSetMacro( Beta, C );
37 virtual C Evaluate( const C& input ) const
39 C a = std::pow( input, this->m_Alpha );
41 return( std::pow( C( 1 ) / ( C( 1 ) + a ), this->m_Beta ) );
43 return( std::pow( C( -1 ) / ( C( 1 ) - a ), this->m_Beta ) );
52 virtual ~InvertCostFunction( )
56 // Purposely not implemented
57 InvertCostFunction( const Self& );
58 void operator=( const Self& );
71 #endif // __FPA__BASE__FUNCTORS__INVERTCOSTFUNCTION__H__