1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Base__Functors__RegionGrow__BinaryThreshold__h__
7 #define __fpa__Base__Functors__RegionGrow__BinaryThreshold__h__
10 #include <itkFunctionBase.h>
22 template< class _TValue >
24 : public itk::FunctionBase< _TValue, bool >
27 typedef BinaryThreshold Self;
28 typedef itk::FunctionBase< _TValue, bool > Superclass;
29 typedef itk::SmartPointer< Self > Pointer;
30 typedef itk::SmartPointer< const Self > ConstPointer;
35 fpa::Base::Functors::RegionGrow::BinaryThreshold,
39 itkGetConstMacro( Lower, _TValue );
40 itkGetConstMacro( Upper, _TValue );
42 itkSetMacro( Lower, _TValue );
43 itkSetMacro( Upper, _TValue );
46 virtual bool Evaluate( const _TValue& input ) const override
48 return( this->m_Lower < input && input < this->m_Upper );
55 this->m_Upper = std::numeric_limits< _TValue >::max( );
56 if( std::numeric_limits< _TValue >::is_integer )
57 this->m_Lower = std::numeric_limits< _TValue >::min( );
59 this->m_Lower = -this->m_Upper;
62 virtual ~BinaryThreshold( )
67 // Purposely not implemented
68 BinaryThreshold( const Self& other );
69 Self& operator=( const Self& other );
84 #endif // __fpa__Base__Functors__RegionGrow__BinaryThreshold__h__