]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Functors/RegionGrow/BinaryThreshold.h
...
[FrontAlgorithms.git] / lib / fpa / Functors / RegionGrow / BinaryThreshold.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Functors__RegionGrow__BinaryThreshold__h__
6 #define __fpa__Functors__RegionGrow__BinaryThreshold__h__
7
8 #include <itkFunctionBase.h>
9
10 namespace fpa
11 {
12   namespace Functors
13   {
14     namespace RegionGrow
15     {
16       /**
17        */
18       template< class _TValue >
19       class BinaryThreshold
20         : public itk::FunctionBase< _TValue, bool >
21       {
22       public:
23         typedef _TValue TValue;
24         typedef itk::FunctionBase< TValue, bool > Superclass;
25         typedef BinaryThreshold                   Self;
26         typedef itk::SmartPointer< Self >         Pointer;
27         typedef itk::SmartPointer< const Self >   ConstPointer;
28
29       public:
30         itkNewMacro( Self );
31         itkTypeMacro(
32           fpa::Functors::RegionGrow::BinaryThreshold, itk::FunctionBase
33           );
34
35         itkGetConstMacro( LowerThreshold, TValue );
36         itkSetMacro( LowerThreshold, TValue );
37
38         itkGetConstMacro( UpperThreshold, TValue );
39         itkSetMacro( UpperThreshold, TValue );
40
41         itkBooleanMacro( Strict );
42         itkGetConstMacro( Strict, bool );
43         itkSetMacro( Strict, bool );
44
45       public:
46         void ThresholdAbove( const TValue& a );
47         void ThresholdBetween( const TValue& a, const TValue& b );
48         void ThresholdBelow( const TValue& a );
49
50         virtual bool Evaluate( const TValue& v ) const override;
51
52       protected:
53         BinaryThreshold( );
54         virtual ~BinaryThreshold( );
55
56       private:
57         // Purposely not implemented.
58         BinaryThreshold( const Self& other );
59         Self& operator=( const Self& other );
60
61       protected:
62         TValue m_LowerThreshold;
63         TValue m_UpperThreshold;
64         bool m_Strict;
65       };
66
67     } // ecapseman
68
69   } // ecapseman
70
71 } // ecapseman
72
73 #ifndef ITK_MANUAL_INSTANTIATION
74 #  include <fpa/Functors/RegionGrow/BinaryThreshold.hxx>
75 #endif // ITK_MANUAL_INSTANTIATION
76
77 #endif // __fpa__Functors__RegionGrow__BinaryThreshold__h__
78 // eof - $RCSfile$