X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FFunctors%2FRegionGrow%2FBinaryThreshold.h;fp=lib%2Ffpa%2FFunctors%2FRegionGrow%2FBinaryThreshold.h;h=57abad4becff658566ed8255f8cf88ce8b068cee;hb=bd89a1af0c14ed2ac0afeca923103de54283cbaf;hp=0000000000000000000000000000000000000000;hpb=a8ac405fe1422bc0792a810f7f0693096a22c20e;p=FrontAlgorithms.git diff --git a/lib/fpa/Functors/RegionGrow/BinaryThreshold.h b/lib/fpa/Functors/RegionGrow/BinaryThreshold.h new file mode 100644 index 0000000..57abad4 --- /dev/null +++ b/lib/fpa/Functors/RegionGrow/BinaryThreshold.h @@ -0,0 +1,77 @@ +// ========================================================================= +// @author Leonardo Florez Valencia +// @email florez-l@javeriana.edu.co +// ========================================================================= +#ifndef __fpa__Functors__RegionGrow__BinaryThreshold__h__ +#define __fpa__Functors__RegionGrow__BinaryThreshold__h__ + +#include + +namespace fpa +{ + namespace Functors + { + namespace RegionGrow + { + /** + */ + template< class _TValue > + class BinaryThreshold + : public itk::FunctionBase< _TValue, bool > + { + public: + typedef _TValue TValue; + typedef itk::FunctionBase< TValue, bool > Superclass; + typedef BinaryThreshold Self; + typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer< const Self > ConstPointer; + + public: + itkNewMacro( Self ); + itkTypeMacro( + fpa::Functors::RegionGrow::BinaryThreshold, itk::FunctionBase + ); + + itkGetConstMacro( LowerThreshold, TValue ); + itkSetMacro( LowerThreshold, TValue ); + + itkGetConstMacro( UpperThreshold, TValue ); + itkSetMacro( UpperThreshold, TValue ); + + itkBooleanMacro( Strict ); + itkGetConstMacro( Strict, bool ); + itkSetMacro( Strict, bool ); + + public: + void ThresholdAbove( const TValue& a ); + void ThresholdBetween( const TValue& a, const TValue& b ); + void ThresholdBelow( const TValue& a ); + + virtual bool Evaluate( const TValue& v ) const override; + + protected: + BinaryThreshold( ); + virtual ~BinaryThreshold( ); + + private: + // Purposely not implemented. + BinaryThreshold( const Self& other ); + Self& operator=( const Self& other ); + + protected: + TValue m_LowerThreshold; + TValue m_UpperThreshold; + bool m_Strict; + }; + + } // ecapseman + + } // ecapseman + +} // ecapseman + +#ifndef ITK_MANUAL_INSTANTIATION +# include +#endif // ITK_MANUAL_INSTANTIATION +#endif // __fpa__Functors__RegionGrow__BinaryThreshold__h__ +// eof - $RCSfile$