]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/RegionGrow.h
...
[FrontAlgorithms.git] / lib / fpa / Base / RegionGrow.h
index a8fcc932aa5dbba92883bb983b872698ad52f4c6..2586033f0f7d1d38ea5eeb491f8a188760bfb6c5 100644 (file)
@@ -1,9 +1,12 @@
+// =========================================================================
+// @author Leonardo Florez Valencia
+// @email florez-l@javeriana.edu.co
+// =========================================================================
+
 #ifndef __fpa__Base__RegionGrow__h__
 #define __fpa__Base__RegionGrow__h__
 
-#include <queue>
-#include <fpa/Config.h>
-#include <fpa/Base/Functors/RegionGrow/Base.h>
+#include <itkFunctionBase.h>
 
 namespace fpa
 {
@@ -11,58 +14,59 @@ namespace fpa
   {
     /**
      */
-    template< class _TSuperclass >
+    template< class _TFilter, class _TMarksInterface, class _TSeedsInterface >
     class RegionGrow
-      : public _TSuperclass
+      : public _TFilter,
+        public _TMarksInterface,
+        public _TSeedsInterface
     {
     public:
       typedef RegionGrow                      Self;
-      typedef _TSuperclass                    Superclass;
+      typedef _TFilter                        Superclass;
+      typedef _TMarksInterface                TMarksInterface;
+      typedef _TSeedsInterface                TSeedsInterface;
       typedef itk::SmartPointer< Self >       Pointer;
       typedef itk::SmartPointer< const Self > ConstPointer;
 
-      typedef typename Superclass::TOutput TOutput;
-      typedef typename Superclass::TVertex TVertex;
-
-      typedef fpa::Base::Functors::RegionGrow::Base< TVertex > TGrowFunction;
+      typedef typename Superclass::TInputValue  TInputValue;
+      typedef typename Superclass::TOutputValue TOutputValue;
+      typedef typename Superclass::TVertex      TVertex;
+      typedef typename Superclass::TVertices    TVertices;
 
-    protected:
-      typedef typename Superclass::_TQueueNode _TQueueNode;
-      typedef std::queue< _TQueueNode > _TQueue;
+      typedef itk::FunctionBase< TInputValue, bool > TIntensityFunctor;
+      typedef itk::FunctionBase< TVertex, bool >     TVertexFunctor;
 
     public:
-      itkTypeMacro( RegionGrow, Algorithm );
+      itkTypeMacro( RegionGrow, TFilter );
 
-      itkGetObjectMacro( GrowFunction, TGrowFunction );
-      itkGetConstMacro( InsideValue, TOutput );
-      itkGetConstMacro( OutsideValue, TOutput );
+      itkGetConstMacro( InsideValue, TOutputValue );
+      itkGetConstMacro( OutsideValue, TOutputValue );
+
+      itkSetMacro( InsideValue, TOutputValue );
+      itkSetMacro( OutsideValue, TOutputValue );
+
+    public:
+      const TIntensityFunctor* GetIntensityPredicate( ) const;
+      const TVertexFunctor* GetVertexPredicate( ) const;
 
-      itkSetObjectMacro( GrowFunction, TGrowFunction );
-      itkSetMacro( InsideValue, TOutput );
-      itkSetMacro( OutsideValue, TOutput );
+      void SetPredicate( TIntensityFunctor* functor );
+      void SetPredicate( TVertexFunctor* functor );
 
     protected:
       RegionGrow( );
       virtual ~RegionGrow( );
 
-      virtual bool _UpdateValue(
-        _TQueueNode& v, const _TQueueNode& p
-        ) override;
-      virtual unsigned long _QueueSize( ) const override;
-      virtual void _QueueClear( ) override;
-      virtual void _QueuePush( const _TQueueNode& node ) override;
-      virtual _TQueueNode _QueuePop( ) override;
+      virtual void GenerateData( ) override;
 
     private:
-      // Purposely not defined
       RegionGrow( const Self& other );
       Self& operator=( const Self& other );
 
     protected:
-      TOutput m_InsideValue;
-      TOutput m_OutsideValue;
-      _TQueue m_Queue;
-      typename TGrowFunction::Pointer m_GrowFunction;
+      typename TIntensityFunctor::Pointer m_IntensityFunctor;
+      typename TVertexFunctor::Pointer m_VertexFunctor;
+      TOutputValue m_InsideValue;
+      TOutputValue m_OutsideValue;
     };
 
   } // ecapseman