]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/Functors/RegionGrow/BinaryThreshold.hxx
...
[FrontAlgorithms.git] / lib / fpa / Image / Functors / RegionGrow / BinaryThreshold.hxx
index 97cf465a2ab811479afd5b3bf92c337a5c6d6b99..4184e03958d4ac649f3f25613ec54a6c762d7fe4 100644 (file)
@@ -1,27 +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 <limits>
-
 // -------------------------------------------------------------------------
-template< class _TImage >
-bool fpa::Image::Functors::RegionGrow::BinaryThreshold< _TImage >::
-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 );
-    return( this->m_Lower <= v && v <= this->m_Upper );
-  }
-  else
-    return( false );
+  return( this->m_Lower < value && value < this->m_Upper );
 }
 
 // -------------------------------------------------------------------------
-template< class _TImage >
-fpa::Image::Functors::RegionGrow::BinaryThreshold< _TImage >::
+template< class _TPixel >
+fpa::Image::Functors::RegionGrow::BinaryThreshold< _TPixel >::
 BinaryThreshold( )
   : Superclass( )
 {
@@ -33,8 +28,8 @@ BinaryThreshold( )
 }
 
 // -------------------------------------------------------------------------
-template< class _TImage >
-fpa::Image::Functors::RegionGrow::BinaryThreshold< _TImage >::
+template< class _TPixel >
+fpa::Image::Functors::RegionGrow::BinaryThreshold< _TPixel >::
 ~BinaryThreshold( )
 {
 }