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::InputImageType InputImageType;
28 typedef typename Superclass::InputPixelType InputPixelType;
29 typedef typename Superclass::OutputType OutputType;
30 typedef typename Superclass::CoordRepType CoordRepType;
31 typedef typename Superclass::IndexType IndexType;
32 typedef typename Superclass::IndexValueType IndexValueType;
33 typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
34 typedef typename Superclass::PointType PointType;
39 RegionGrowThresholdFunction,
40 RegionGrowAllBelongsFunction
43 itkGetConstMacro( LowerThreshold, InputPixelType );
44 itkGetConstMacro( UpperThreshold, InputPixelType );
46 itkSetMacro( LowerThreshold, InputPixelType );
47 itkSetMacro( UpperThreshold, InputPixelType );
50 virtual OutputType EvaluateAtIndex( const IndexType& index ) const
52 const I* img = this->GetInputImage( );
55 if( this->IsInsideBuffer( index ) )
57 InputPixelType v = img->GetPixel( index );
59 this->m_LowerThreshold <= v &&
60 v <= this->m_UpperThreshold
70 RegionGrowThresholdFunction( )
72 m_LowerThreshold( std::numeric_limits< InputPixelType >::min( ) ),
73 m_UpperThreshold( std::numeric_limits< InputPixelType >::max( ) )
75 virtual ~RegionGrowThresholdFunction( )
79 // Purposely not implemented
80 RegionGrowThresholdFunction( const Self& );
81 void operator=( const Self& );
84 InputPixelType m_LowerThreshold;
85 InputPixelType m_UpperThreshold;
94 #endif // __FPA__IMAGE__FUNCTORS__REGIONGROWTHRESHOLDFUNCTION__H__