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=b0fe54c04a753ba47bdab5a2e0bcca1bb56978c5;hb=2047276c8f1a02432fbcc7014722d460d6c1e60f;hp=0000000000000000000000000000000000000000;hpb=3c639e5da479c7216a0a302ffa156ac6762caeed;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..b0fe54c --- /dev/null +++ b/lib/fpa/Functors/RegionGrow/BinaryThreshold.h @@ -0,0 +1,78 @@ +// ========================================================================= +// @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$