X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FFunctors%2FRegionGrow%2FBinaryThreshold.hxx;fp=lib%2Ffpa%2FFunctors%2FRegionGrow%2FBinaryThreshold.hxx;h=0000000000000000000000000000000000000000;hb=a8ac405fe1422bc0792a810f7f0693096a22c20e;hp=f7ad48f2a09bc9cb2fad5c30b40962c4fc4c1e14;hpb=8abe87eaa0d29ba667d5cbf35f4ca1ca2e38c6c4;p=FrontAlgorithms.git diff --git a/lib/fpa/Functors/RegionGrow/BinaryThreshold.hxx b/lib/fpa/Functors/RegionGrow/BinaryThreshold.hxx deleted file mode 100644 index f7ad48f..0000000 --- a/lib/fpa/Functors/RegionGrow/BinaryThreshold.hxx +++ /dev/null @@ -1,73 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__Functors__RegionGrow__BinaryThreshold__hxx__ -#define __fpa__Functors__RegionGrow__BinaryThreshold__hxx__ - -#include - -// ------------------------------------------------------------------------- -template< class _TValue > -void fpa::Functors::RegionGrow::BinaryThreshold< _TValue >:: -ThresholdAbove( const TValue& a ) -{ - this->SetLowerThreshold( a ); - this->SetUpperThreshold( std::numeric_limits< _TValue >::max( ) ); -} - -// ------------------------------------------------------------------------- -template< class _TValue > -void fpa::Functors::RegionGrow::BinaryThreshold< _TValue >:: -ThresholdBetween( const TValue& a, const TValue& b ) -{ - this->SetLowerThreshold( ( a < b )? a: b ); - this->SetUpperThreshold( ( b < a )? a: b ); -} - -// ------------------------------------------------------------------------- -template< class _TValue > -void fpa::Functors::RegionGrow::BinaryThreshold< _TValue >:: -ThresholdBelow( const TValue& a ) -{ - if( std::numeric_limits< _TValue >::is_integer ) - this->SetLowerThreshold( std::numeric_limits< _TValue >::min( ) ); - else - this->SetLowerThreshold( -std::numeric_limits< _TValue >::max( ) ); - this->SetUpperThreshold( a ); -} - -// ------------------------------------------------------------------------- -template< class _TValue > -bool fpa::Functors::RegionGrow::BinaryThreshold< _TValue >:: -Evaluate( const TValue& v ) const -{ - if( this->m_Strict ) - return( this->m_LowerThreshold < v && v < this->m_UpperThreshold ); - else - return( this->m_LowerThreshold <= v && v <= this->m_UpperThreshold ); -} - -// ------------------------------------------------------------------------- -template< class _TValue > -fpa::Functors::RegionGrow::BinaryThreshold< _TValue >:: -BinaryThreshold( ) - : Superclass( ), - m_Strict( true ) -{ - this->m_UpperThreshold = std::numeric_limits< _TValue >::max( ); - if( std::numeric_limits< _TValue >::is_integer ) - this->m_LowerThreshold = std::numeric_limits< _TValue >::min( ); - else - this->m_LowerThreshold = -this->m_UpperThreshold; -} - -// ------------------------------------------------------------------------- -template< class _TValue > -fpa::Functors::RegionGrow::BinaryThreshold< _TValue >:: -~BinaryThreshold( ) -{ -} - -#endif // __fpa__Functors__RegionGrow__BinaryThreshold__hxx__ -// eof - $RCSfile$