X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=libs%2Ffpa%2FImage%2FFunctors%2FRegionGrow%2FBinaryThreshold.hxx;h=4184e03958d4ac649f3f25613ec54a6c762d7fe4;hb=3636868ab0f433aa5e8e839556b76febe0db3494;hp=b41db088b022025d1754ecb28cafcf8c6930c2f0;hpb=20916948d3878c722b73e7ee86df87ff2df9d0fe;p=FrontAlgorithms.git diff --git a/libs/fpa/Image/Functors/RegionGrow/BinaryThreshold.hxx b/libs/fpa/Image/Functors/RegionGrow/BinaryThreshold.hxx index b41db08..4184e03 100644 --- a/libs/fpa/Image/Functors/RegionGrow/BinaryThreshold.hxx +++ b/libs/fpa/Image/Functors/RegionGrow/BinaryThreshold.hxx @@ -1,35 +1,22 @@ +// ========================================================================= +// @author Leonardo Florez Valencia +// @email florez-l@javeriana.edu.co +// ========================================================================= + #ifndef __fpa__Image__Functors__RegionGrow__BinaryThreshold__hxx__ #define __fpa__Image__Functors__RegionGrow__BinaryThreshold__hxx__ -#include - // ------------------------------------------------------------------------- -template< class _TImage, class _TOutput > -_TOutput -fpa::Image::Functors::RegionGrow::BinaryThreshold< _TImage, _TOutput >:: -Evaluate( const TIndex& a, const TIndex& b ) const +template< class _TPixel > +bool fpa::Image::Functors::RegionGrow::BinaryThreshold< _TPixel >:: +Evaluate( const TPixel& value ) const { - const _TImage* im = - dynamic_cast< const _TImage* >( this->m_Image.GetPointer( ) ); - if( im != NULL ) - { - TPixel v = im->GetPixel( b ); - - std::cout << a << " " << v << " " << this->m_Lower << " " << this->m_Upper << std::endl; - - return( - ( this->m_Lower < v && v < this->m_Upper )? - this->m_InsideValue: - this->m_OutsideValue - ); - } - else - return( this->m_OutsideValue ); + return( this->m_Lower < value && value < this->m_Upper ); } // ------------------------------------------------------------------------- -template< class _TImage, class _TOutput > -fpa::Image::Functors::RegionGrow::BinaryThreshold< _TImage, _TOutput >:: +template< class _TPixel > +fpa::Image::Functors::RegionGrow::BinaryThreshold< _TPixel >:: BinaryThreshold( ) : Superclass( ) { @@ -41,8 +28,8 @@ BinaryThreshold( ) } // ------------------------------------------------------------------------- -template< class _TImage, class _TOutput > -fpa::Image::Functors::RegionGrow::BinaryThreshold< _TImage, _TOutput >:: +template< class _TPixel > +fpa::Image::Functors::RegionGrow::BinaryThreshold< _TPixel >:: ~BinaryThreshold( ) { }