]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/MoriRegionGrow.h
...
[FrontAlgorithms.git] / lib / fpa / Base / MoriRegionGrow.h
index 40f59cd3cb715d78aebcad34daebf63d20038f48..d8f2ee03b37bf743a54f7fa226061c5e59e8a0a4 100644 (file)
@@ -1,51 +1,86 @@
+// =========================================================================
+// @author Leonardo Florez Valencia
+// @email florez-l@javeriana.edu.co
+// =========================================================================
+
 #ifndef __fpa__Base__MoriRegionGrow__h__
 #define __fpa__Base__MoriRegionGrow__h__
 
-#include <queue>
-#include <fpa/Config.h>
-#include <fpa/Base/RegionGrow.h>
-
 namespace fpa
 {
   namespace Base
   {
     /**
      */
-    template< class _TSuperclass >
+    template< class _TFilter, class _TMarksInterface, class _TSeedsInterface >
     class MoriRegionGrow
-      : public fpa::Base::RegionGrow< _TSuperclass >
+      : public _TFilter,
+        public _TMarksInterface,
+        public _TSeedsInterface
     {
     public:
-      typedef MoriRegionGrow                        Self;
-      typedef fpa::Base::RegionGrow< _TSuperclass > Superclass;
-      typedef itk::SmartPointer< Self >             Pointer;
-      typedef itk::SmartPointer< const Self >       ConstPointer;
+      typedef MoriRegionGrow                  Self;
+      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 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 typename Superclass::_TQueue     _TQueue;
+      struct TCurveData
+      {
+        TInputValue XValue;
+        unsigned long YValue;
+        double Diff1;
+        TCurveData( TInputValue v, unsigned long c )
+          {
+            this->XValue = v;
+            this->YValue = c;
+            this->Diff1 = double( 0 );
+          }
+      };
+      typedef std::vector< TCurveData > TCurve;
+
+    public:
+      itkTypeMacro( MoriRegionGrow, TFilter );
+
+      itkGetConstMacro( LowerThreshold, TInputValue );
+      itkGetConstMacro( UpperThreshold, TInputValue );
+      itkGetConstMacro( DeltaThreshold, TInputValue );
+      itkGetConstMacro( Curve, TCurve );
+      itkGetConstMacro( OptimumThreshold, TInputValue );
+
+      itkSetMacro( LowerThreshold, TInputValue );
+      itkSetMacro( UpperThreshold, TInputValue );
+      itkSetMacro( DeltaThreshold, TInputValue );
 
     public:
-      itkTypeMacro( MoriRegionGrow, Algorithm );
+      void SetThresholdRange(
+        const TInputValue& lower, const TInputValue& upper,
+        const TInputValue& delta = TInputValue( 1 )
+        );
 
     protected:
       MoriRegionGrow( );
       virtual ~MoriRegionGrow( );
 
-      virtual bool _UpdateValue(
-        _TQueueNode& v, const _TQueueNode& p
-        ) override;
+      virtual void GenerateData( ) override;
 
     private:
-      // Purposely not defined
       MoriRegionGrow( const Self& other );
       Self& operator=( const Self& other );
 
     protected:
-      _TQueue m_AuxilaryQueue;
+      TInputValue  m_LowerThreshold;
+      TInputValue  m_UpperThreshold;
+      TInputValue  m_DeltaThreshold;
+
+      TCurve m_Curve;
+      TInputValue  m_OptimumThreshold;
     };
 
   } // ecapseman