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
47 const I* img = this->GetSpace( );
50 TPixel v = img->GetPixel( idx );
52 !( v < this->m_LowerThreshold || this->m_UpperThreshold < v )
60 RegionGrowThresholdFunction( )
63 itk::NumericTraits< TPixel >::min( this->m_LowerThreshold );
64 itk::NumericTraits< TPixel >::max( this->m_UpperThreshold );
66 virtual ~RegionGrowThresholdFunction( )
70 // Purposely not implemented
71 RegionGrowThresholdFunction( const Self& );
72 void operator=( const Self& );
75 TPixel m_LowerThreshold;
76 TPixel m_UpperThreshold;
85 #endif // __FPA__IMAGE__FUNCTORS__REGIONGROWTHRESHOLDFUNCTION__H__