1 // -------------------------------------------------------------------------
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // -------------------------------------------------------------------------
5 #ifndef __CPEXTENSIONS__ALGORITHMS__UNARYTHRESHOLDIMAGEFILTER__H__
6 #define __CPEXTENSIONS__ALGORITHMS__UNARYTHRESHOLDIMAGEFILTER__H__
8 #include <itkUnaryFunctorImageFilter.h>
10 namespace cpExtensions
18 template< typename _TInput >
23 virtual ~UnaryThreshold( );
25 const _TInput& GetThreshold( ) const;
26 const _TInput& GetInsideValue( ) const;
27 const _TInput& GetOutsideValue( ) const;
28 const bool& GetStrict( ) const;
32 void SetStrict( bool s );
33 void SetThreshold( const _TInput& thresh );
34 void SetInsideValue( const _TInput& value );
35 void SetOutsideValue( const _TInput& value );
36 bool operator!=( const UnaryThreshold& other ) const;
37 bool operator==( const UnaryThreshold& other ) const;
38 _TInput operator()( const _TInput& A ) const;
42 _TInput m_InsideValue;
43 _TInput m_OutsideValue;
50 template< class _TImage >
51 class UnaryThresholdImageFilter
52 : public itk::UnaryFunctorImageFilter< _TImage, _TImage, cpExtensions::Algorithms::Functor::UnaryThreshold< typename _TImage::PixelType > >
56 typedef typename _TImage::PixelType TPixel;
57 typedef cpExtensions::Algorithms::Functor::UnaryThreshold< TPixel > TFunctor;
58 typedef itk::UnaryFunctorImageFilter< _TImage, _TImage, TFunctor > Superclass;
59 typedef UnaryThresholdImageFilter Self;
60 typedef itk::SmartPointer< Self > Pointer;
61 typedef itk::SmartPointer< const Self > ConstPointer;
63 typedef _TImage TImage;
67 itkTypeMacro( UnaryThresholdImageFilter, itkUnaryFunctorImageFilter );
70 const TPixel& GetThreshold( ) const;
71 const TPixel& GetInsideValue( ) const;
72 const TPixel& GetOutsideValue( ) const;
73 const bool& GetStrict( ) const;
77 void SetStrict( bool s );
78 void SetThreshold( const TPixel& thresh );
79 void SetInsideValue( const TPixel& value );
80 void SetOutsideValue( const TPixel& value );
83 UnaryThresholdImageFilter( );
84 virtual ~UnaryThresholdImageFilter( );
87 // Purposely not implemented
88 UnaryThresholdImageFilter( const Self& );
89 void operator=( const Self& );
96 #ifndef ITK_MANUAL_INSTANTIATION
97 # include <cpExtensions/Algorithms/UnaryThresholdImageFilter.hxx>
98 #endif // ITK_MANUAL_INSTANTIATION
100 #endif // __CPEXTENSIONS__ALGORITHMS__UNARYTHRESHOLDIMAGEFILTER__H__