]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/Functors/RegionGrowBinaryThreshold.hxx
53e3b2edb2e951872146848d1fc39e8902c8be40
[FrontAlgorithms.git] / lib / fpa / Image / Functors / RegionGrowBinaryThreshold.hxx
1 #ifndef __fpa__Image__Functors__RegionGrowBinaryThreshold__hxx__
2 #define __fpa__Image__Functors__RegionGrowBinaryThreshold__hxx__
3
4 // -------------------------------------------------------------------------
5 template< class _TImage >
6 bool fpa::Image::Functors::RegionGrowBinaryThreshold< _TImage >::
7 Evaluate( const TIndex& a, const TIndex& b ) const
8 {
9   const _TImage* im =
10     dynamic_cast< const _TImage* >( this->m_Image.GetPointer( ) );
11   TPixel v = im->GetPixel( b );
12   return( this->m_LowerThreshold <= v && v <= this->m_UpperThreshold );
13 }
14
15 // -------------------------------------------------------------------------
16 template< class _TImage >
17 fpa::Image::Functors::RegionGrowBinaryThreshold< _TImage >::
18 RegionGrowBinaryThreshold( )
19   : Superclass( ),
20     m_LowerThreshold( TPixel( 0 ) ),
21     m_UpperThreshold( std::numeric_limits< TPixel >::max( ) )
22 {
23 }
24
25 // -------------------------------------------------------------------------
26 template< class _TImage >
27 fpa::Image::Functors::RegionGrowBinaryThreshold< _TImage >::
28 ~RegionGrowBinaryThreshold( )
29 {
30 }
31
32 #endif // __fpa__Image__Functors__RegionGrowBinaryThreshold__hxx__
33
34 // eof - $RCSfile$