]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/Functors/RegionGrowBinaryThreshold.hxx
...
[FrontAlgorithms.git] / lib / fpa / Image / Functors / RegionGrowBinaryThreshold.hxx
diff --git a/lib/fpa/Image/Functors/RegionGrowBinaryThreshold.hxx b/lib/fpa/Image/Functors/RegionGrowBinaryThreshold.hxx
new file mode 100644 (file)
index 0000000..53e3b2e
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef __fpa__Image__Functors__RegionGrowBinaryThreshold__hxx__
+#define __fpa__Image__Functors__RegionGrowBinaryThreshold__hxx__
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+bool fpa::Image::Functors::RegionGrowBinaryThreshold< _TImage >::
+Evaluate( const TIndex& a, const TIndex& b ) const
+{
+  const _TImage* im =
+    dynamic_cast< const _TImage* >( this->m_Image.GetPointer( ) );
+  TPixel v = im->GetPixel( b );
+  return( this->m_LowerThreshold <= v && v <= this->m_UpperThreshold );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+fpa::Image::Functors::RegionGrowBinaryThreshold< _TImage >::
+RegionGrowBinaryThreshold( )
+  : Superclass( ),
+    m_LowerThreshold( TPixel( 0 ) ),
+    m_UpperThreshold( std::numeric_limits< TPixel >::max( ) )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+fpa::Image::Functors::RegionGrowBinaryThreshold< _TImage >::
+~RegionGrowBinaryThreshold( )
+{
+}
+
+#endif // __fpa__Image__Functors__RegionGrowBinaryThreshold__hxx__
+
+// eof - $RCSfile$