1 #ifndef __FPA__IMAGE__FUNCTORS__REGIONGROWTHRESHOLDFUNCTION__H__
2 #define __FPA__IMAGE__FUNCTORS__REGIONGROWTHRESHOLDFUNCTION__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 typename Superclass::TInputImage TInputImage;
28 typedef typename Superclass::TOutputValue TOutputValue;
29 typedef typename Superclass::TIndex TIndex;
30 typedef typename I::PixelType TPixel;
35 RegionGrowThresholdFunction,
36 RegionGrowAllBelongsFunction
39 itkGetConstMacro( LowerThreshold, TPixel );
40 itkGetConstMacro( UpperThreshold, TPixel );
42 itkSetMacro( LowerThreshold, TPixel );
43 itkSetMacro( UpperThreshold, TPixel );
46 virtual TOutputValue Evaluate( const TIndex& idx ) const
48 const I* img = this->GetInputImage( );
52 if( this->IsInsideBuffer( idx ) )
55 TPixel v = img->GetPixel( idx );
58 << this->m_LowerThreshold << " "
59 << this->m_UpperThreshold << std::endl;
61 this->m_LowerThreshold <= v && v < this->m_UpperThreshold
71 RegionGrowThresholdFunction( )
73 m_LowerThreshold( std::numeric_limits< TPixel >::min( ) ),
74 m_UpperThreshold( std::numeric_limits< TPixel >::max( ) )
76 virtual ~RegionGrowThresholdFunction( )
80 // Purposely not implemented
81 RegionGrowThresholdFunction( const Self& );
82 void operator=( const Self& );
85 TPixel m_LowerThreshold;
86 TPixel m_UpperThreshold;
95 #endif // __FPA__IMAGE__FUNCTORS__REGIONGROWTHRESHOLDFUNCTION__H__