]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/Functors/RegionGrow/Base.h
...
[FrontAlgorithms.git] / lib / fpa / Base / Functors / RegionGrow / Base.h
index 7daf46e53fc1ddd9ad48bf1834805f701e30b4a7..d2c37aae655ef17b808cf0f00516febad67f7c32 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <itkObject.h>
 #include <itkObjectFactory.h>
+#include <fpa/Base/Functors/VertexCostFunctionBase.h>
 
 namespace fpa
 {
@@ -14,29 +15,36 @@ namespace fpa
       {
         /**
          */
-        template< class _TVertex >
+        template< class _TVertex, class _TOutput >
         class Base
-          : public itk::Object
+          : public fpa::Base::Functors::VertexCostFunctionBase< _TVertex, _TOutput >
         {
         public:
+          typedef fpa::Base::Functors::VertexCostFunctionBase< _TVertex, _TOutput > Superclass;
           typedef Base                            Self;
-          typedef itk::Object                     Superclass;
           typedef itk::SmartPointer< Self >       Pointer;
           typedef itk::SmartPointer< const Self > ConstPointer;
 
           typedef _TVertex TVertex;
+          typedef _TOutput TOutput;
 
         public:
           itkTypeMacro( Base, itk::Object );
 
+          itkGetConstMacro( InsideValue, _TOutput );
+          itkGetConstMacro( OutsideValue, _TOutput );
+
+          itkSetMacro( InsideValue, _TOutput );
+          itkSetMacro( OutsideValue, _TOutput );
+
         public:
-          virtual bool Evaluate(
-            const TVertex& a, const TVertex& b
-            ) const = 0;
+          virtual TOutput Evaluate( const TVertex& a, const TVertex& b ) const = 0;
 
         protected:
           Base( )
-            : Superclass( )
+            : Superclass( ),
+              m_InsideValue( TOutput( 1 ) ),
+              m_OutsideValue( TOutput( 0 ) )
             { }
           virtual ~Base( )
             { }
@@ -45,6 +53,10 @@ namespace fpa
           // Purposely not defined
           Base( const Self& other );
           Self& operator=( const Self& other );
+
+        protected:
+          _TOutput m_InsideValue;
+          _TOutput m_OutsideValue;
         };
 
       } // ecapseman