X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FImage%2FFunctors%2FRegionGrow%2FBinaryThreshold.hxx;h=e1853e2ca7db676bdb483d41e91f21e8497f29da;hb=40fb0405cfef444001429f8ba49c407ce9168a94;hp=97cf465a2ab811479afd5b3bf92c337a5c6d6b99;hpb=cf298be2de026712c5ab3487978e3a6954a809cd;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/Functors/RegionGrow/BinaryThreshold.hxx b/lib/fpa/Image/Functors/RegionGrow/BinaryThreshold.hxx index 97cf465..e1853e2 100644 --- a/lib/fpa/Image/Functors/RegionGrow/BinaryThreshold.hxx +++ b/lib/fpa/Image/Functors/RegionGrow/BinaryThreshold.hxx @@ -4,8 +4,9 @@ #include // ------------------------------------------------------------------------- -template< class _TImage > -bool fpa::Image::Functors::RegionGrow::BinaryThreshold< _TImage >:: +template< class _TImage, class _TOutput > +_TOutput +fpa::Image::Functors::RegionGrow::BinaryThreshold< _TImage, _TOutput >:: Evaluate( const TIndex& a, const TIndex& b ) const { const _TImage* im = @@ -13,15 +14,19 @@ Evaluate( const TIndex& a, const TIndex& b ) const if( im != NULL ) { TPixel v = im->GetPixel( b ); - return( this->m_Lower <= v && v <= this->m_Upper ); + return( + ( this->m_Lower <= v && v <= this->m_Upper )? + this->m_InsideValue: + this->m_OutsideValue + ); } else - return( false ); + return( this->m_OutsideValue ); } // ------------------------------------------------------------------------- -template< class _TImage > -fpa::Image::Functors::RegionGrow::BinaryThreshold< _TImage >:: +template< class _TImage, class _TOutput > +fpa::Image::Functors::RegionGrow::BinaryThreshold< _TImage, _TOutput >:: BinaryThreshold( ) : Superclass( ) { @@ -33,8 +38,8 @@ BinaryThreshold( ) } // ------------------------------------------------------------------------- -template< class _TImage > -fpa::Image::Functors::RegionGrow::BinaryThreshold< _TImage >:: +template< class _TImage, class _TOutput > +fpa::Image::Functors::RegionGrow::BinaryThreshold< _TImage, _TOutput >:: ~BinaryThreshold( ) { }