]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/Functors/RegionGrowThresholdFunction.h
Some more debug... almost there
[FrontAlgorithms.git] / lib / fpa / Image / Functors / RegionGrowThresholdFunction.h
index 00a813f682a1694b756ca5d0d7238052a6d5df27..6da586d2249271f1017dcf78399993d2846d7bb9 100644 (file)
@@ -24,14 +24,10 @@ namespace fpa
         typedef itk::SmartPointer< const Self >   ConstPointer;
 
         // Superclass' types
-        typedef typename Superclass::InputImageType      InputImageType;
-        typedef typename Superclass::InputPixelType      InputPixelType;
-        typedef typename Superclass::OutputType          OutputType;
-        typedef typename Superclass::CoordRepType        CoordRepType;
-        typedef typename Superclass::IndexType           IndexType;
-        typedef typename Superclass::IndexValueType      IndexValueType;
-        typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
-        typedef typename Superclass::PointType           PointType;
+        typedef typename Superclass::TInputImage  TInputImage;
+        typedef typename Superclass::TOutputValue TOutputValue;
+        typedef typename Superclass::TIndex       TIndex;
+        typedef typename I::PixelType             TPixel;
 
       public:
         itkNewMacro( Self );
@@ -40,27 +36,32 @@ namespace fpa
           RegionGrowAllBelongsFunction
           );
 
-        itkGetConstMacro( LowerThreshold, InputPixelType );
-        itkGetConstMacro( UpperThreshold, InputPixelType );
+        itkGetConstMacro( LowerThreshold, TPixel );
+        itkGetConstMacro( UpperThreshold, TPixel );
 
-        itkSetMacro( LowerThreshold, InputPixelType );
-        itkSetMacro( UpperThreshold, InputPixelType );
+        itkSetMacro( LowerThreshold, TPixel );
+        itkSetMacro( UpperThreshold, TPixel );
 
       public:
-        virtual OutputType EvaluateAtIndex( const IndexType& index ) const
+        virtual TOutputValue Evaluate( const TIndex& idx ) const
           {
             const I* img = this->GetInputImage( );
             if( img != NULL )
             {
-              if( this->IsInsideBuffer( index ) )
-              {
-                InputPixelType v = img->GetPixel( index );
-                return(
-                  this->m_LowerThreshold <= v &&
-                  v <= this->m_UpperThreshold
-                  );
-
-              } // fi
+              /* 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
+                );
+
+              // TODO: } // fi
 
             } // fi
             return( false );
@@ -69,8 +70,8 @@ namespace fpa
       protected:
         RegionGrowThresholdFunction( )
           : Superclass( ),
-            m_LowerThreshold( std::numeric_limits< InputPixelType >::min( ) ),
-            m_UpperThreshold( std::numeric_limits< InputPixelType >::max( ) )
+            m_LowerThreshold( std::numeric_limits< TPixel >::min( ) ),
+            m_UpperThreshold( std::numeric_limits< TPixel >::max( ) )
           { }
         virtual ~RegionGrowThresholdFunction( )
           { }
@@ -81,8 +82,8 @@ namespace fpa
         void operator=( const Self& );
 
       protected:
-        InputPixelType m_LowerThreshold;
-        InputPixelType m_UpperThreshold;
+        TPixel m_LowerThreshold;
+        TPixel m_UpperThreshold;
       };
 
     } // ecapseman