1 /* =======================================================================
2 * @author: Leonardo Florez-Valencia
3 * @email: florez-l@javeriana.edu.co
4 * =======================================================================
7 #ifndef __ivq__ITK__ThresholdFunction__h__
8 #define __ivq__ITK__ThresholdFunction__h__
12 #include <itkFunctionBase.h>
20 template< class _TIn, class _TOut >
21 class ThresholdFunction
22 : public itk::FunctionBase< _TIn, _TOut >
25 typedef ThresholdFunction Self;
26 typedef itk::FunctionBase< _TIn, _TOut > Superclass;
27 typedef itk::SmartPointer< Self > Pointer;
28 typedef itk::SmartPointer< const Self > ConstPointer;
30 typedef typename Superclass::InputType TInput;
31 typedef typename Superclass::OutputType TOutput;
35 itkTypeMacro( ivq::ITK::ThresholdFunction, itk::FunctionBase );
37 itkBooleanMacro( Strict );
38 itkBooleanMacro( Binary );
40 itkGetConstMacro( LowerThreshold, _TIn );
41 itkGetConstMacro( UpperThreshold, _TIn );
42 itkGetConstMacro( Strict, bool );
43 itkGetConstMacro( Binary, bool );
44 itkGetConstMacro( InsideValue, _TOut );
45 itkGetConstMacro( OutsideValue, _TOut );
47 itkSetMacro( LowerThreshold, _TIn );
48 itkSetMacro( UpperThreshold, _TIn );
49 itkSetMacro( Strict, bool );
50 itkSetMacro( Binary, bool );
51 itkSetMacro( InsideValue, _TOut );
52 itkSetMacro( OutsideValue, _TOut );
55 void SetBetween( const _TIn& lower, const _TIn& upper );
56 void SetBelow( const _TIn& value );
57 void SetAbove( const _TIn& value );
59 virtual _TOut Evaluate( const _TIn& in ) const override;
63 virtual ~ThresholdFunction( );
66 // Purposely not implemented
67 ThresholdFunction( const Self& other );
68 Self& operator=( const Self& other );
71 _TIn m_LowerThreshold;
72 _TIn m_UpperThreshold;
83 #ifndef ITK_MANUAL_INSTANTIATION
84 # include <ivq/ITK/ThresholdFunction.hxx>
85 #endif // ITK_MANUAL_INSTANTIATION
87 #endif // __ivq__ITK__ThresholdFunction__h__