1 #ifndef __FPA__IMAGE__FUNCTORS__REGIONGROWTHRESHOLDFUNCTION__H__
2 #define __FPA__IMAGE__FUNCTORS__REGIONGROWTHRESHOLDFUNCTION__H__
4 #include <itkNumericTraits.h>
5 #include <fpa/Image/Functors/RegionGrowAllBelongsFunction.h>
16 class RegionGrowThresholdFunction
17 : public RegionGrowAllBelongsFunction< I >
20 /// Type-related and pointers
21 typedef RegionGrowThresholdFunction Self;
22 typedef RegionGrowAllBelongsFunction< I > Superclass;
23 typedef itk::SmartPointer< Self > Pointer;
24 typedef itk::SmartPointer< const Self > ConstPointer;
27 typedef I TInputImage;
28 typedef typename I::IndexType TIndex;
29 typedef typename I::PixelType TPixel;
34 RegionGrowThresholdFunction,
35 RegionGrowAllBelongsFunction
38 itkGetConstMacro( LowerThreshold, TPixel );
39 itkGetConstMacro( UpperThreshold, TPixel );
41 itkSetMacro( LowerThreshold, TPixel );
42 itkSetMacro( UpperThreshold, TPixel );
45 virtual bool Evaluate( const TIndex& idx ) const ITK_OVERRIDE
47 const I* img = this->GetSpace( );
51 TPixel v = img->GetPixel( idx );
53 !( v < this->m_LowerThreshold || this->m_UpperThreshold < v )
61 RegionGrowThresholdFunction( )
64 itk::NumericTraits< TPixel >::min( this->m_LowerThreshold );
65 itk::NumericTraits< TPixel >::max( this->m_UpperThreshold );
67 virtual ~RegionGrowThresholdFunction( )
71 // Purposely not implemented
72 RegionGrowThresholdFunction( const Self& );
73 void operator=( const Self& );
76 TPixel m_LowerThreshold;
77 TPixel m_UpperThreshold;
86 #endif // __FPA__IMAGE__FUNCTORS__REGIONGROWTHRESHOLDFUNCTION__H__