// ========================================================================= // @author Leonardo Florez Valencia // @email florez-l@javeriana.edu.co // ========================================================================= #ifndef __fpa__Base__Functors__RegionGrow__BinaryThreshold__h__ #define __fpa__Base__Functors__RegionGrow__BinaryThreshold__h__ #include #include namespace fpa { namespace Base { namespace Functors { namespace RegionGrow { /** */ template< class _TValue > class BinaryThreshold : public itk::FunctionBase< _TValue, bool > { public: typedef BinaryThreshold Self; typedef itk::FunctionBase< _TValue, bool > Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; public: itkNewMacro( Self ); itkTypeMacro( fpa::Base::Functors::RegionGrow::BinaryThreshold, itk::FunctionBase ); itkGetConstMacro( Lower, _TValue ); itkGetConstMacro( Upper, _TValue ); itkSetMacro( Lower, _TValue ); itkSetMacro( Upper, _TValue ); public: virtual bool Evaluate( const _TValue& input ) const override { return( this->m_Lower < input && input < this->m_Upper ); } protected: BinaryThreshold( ) : Superclass( ) { this->m_Upper = std::numeric_limits< _TValue >::max( ); if( std::numeric_limits< _TValue >::is_integer ) this->m_Lower = std::numeric_limits< _TValue >::min( ); else this->m_Lower = -this->m_Upper; } virtual ~BinaryThreshold( ) { } private: // Purposely not implemented BinaryThreshold( const Self& other ); Self& operator=( const Self& other ); protected: _TValue m_Lower; _TValue m_Upper; }; } // ecapseman } // ecapseman } // ecapseman } // ecapseman #endif // __fpa__Base__Functors__RegionGrow__BinaryThreshold__h__ // eof - $RCSfile$