]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/Functors/RegionGrowThresholdFunction.h
CMake updated. Some other filters added.
[FrontAlgorithms.git] / lib / fpa / Image / Functors / RegionGrowThresholdFunction.h
index 6da586d2249271f1017dcf78399993d2846d7bb9..3d7d5ac8b167ff413ead2f2ac13d18b6057d1e4c 100644 (file)
@@ -24,10 +24,9 @@ namespace fpa
         typedef itk::SmartPointer< const Self >   ConstPointer;
 
         // Superclass' types
-        typedef typename Superclass::TInputImage  TInputImage;
-        typedef typename Superclass::TOutputValue TOutputValue;
-        typedef typename Superclass::TIndex       TIndex;
-        typedef typename I::PixelType             TPixel;
+        typedef I                     TInputImage;
+        typedef typename I::IndexType TIndex;
+        typedef typename I::PixelType TPixel;
 
       public:
         itkNewMacro( Self );
@@ -43,26 +42,16 @@ namespace fpa
         itkSetMacro( UpperThreshold, TPixel );
 
       public:
-        virtual TOutputValue Evaluate( const TIndex& idx ) const
+        virtual bool Evaluate( const TIndex& idx ) const
           {
-            const I* img = this->GetInputImage( );
+            const I* img = this->GetSpace( );
             if( img != NULL )
             {
-              /* TODO
-                 if( this->IsInsideBuffer( idx ) )
-                 {
-              */
               TPixel v = img->GetPixel( idx );
-              std::cout
-                << v << " "
-                << this->m_LowerThreshold << " "
-                << this->m_UpperThreshold << std::endl;
               return(
-                this->m_LowerThreshold <= v && v < this->m_UpperThreshold
+                !( v < this->m_LowerThreshold || this->m_UpperThreshold < v )
                 );
 
-              // TODO: } // fi
-
             } // fi
             return( false );
           }