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( )
62 m_LowerThreshold( itk::NumericTraits< TPixel >::min( ) ),
63 m_UpperThreshold( itk::NumericTraits< TPixel >::max( ) )
65 virtual ~RegionGrowThresholdFunction( )
69 // Purposely not implemented
70 RegionGrowThresholdFunction( const Self& );
71 void operator=( const Self& );
74 TPixel m_LowerThreshold;
75 TPixel m_UpperThreshold;
84 #endif // __FPA__IMAGE__FUNCTORS__REGIONGROWTHRESHOLDFUNCTION__H__