]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Common/OriginalRandomWalker.h
...
[FrontAlgorithms.git] / lib / fpa / Common / OriginalRandomWalker.h
index d4af732998028d0b9714391972d5432b098669c1..0c3a9f82f08a8219a10480b1062415a9d526dcf7 100644 (file)
@@ -11,6 +11,7 @@
 #include <itkImage.h>
 #include <itkImageToImageFilter.h>
 #include <itkSimpleFastMutexLock.h>
+#include <fpa/Functors/VertexFunction.h>
 
 namespace fpa
 {
@@ -38,6 +39,8 @@ namespace fpa
       typedef typename TImage::RegionType TRegion;
       typedef typename TLabels::PixelType TLabel;
 
+      typedef fpa::Functors::VertexFunction< TIndex, TScalar > TEdgeFunction;
+
     protected:
       struct _TBoundaryThreadStruct
       {
@@ -68,21 +71,17 @@ namespace fpa
         fpa::Common::OriginalRandomWalker, itk::ImageToImageFilter
         );
 
-      itkGetConstMacro( Beta, TScalar );
-      itkSetMacro( Beta, TScalar );
-
-      itkGetConstMacro( Epsilon, TScalar );
-      itkSetMacro( Epsilon, TScalar );
-
-      itkBooleanMacro( NormalizeWeights );
-      itkGetConstMacro( NormalizeWeights, bool );
-      itkSetMacro( NormalizeWeights, bool );
+      itkGetConstObjectMacro( EdgeFunction, TEdgeFunction );
+      itkGetObjectMacro( EdgeFunction, TEdgeFunction );
+      itkSetObjectMacro( EdgeFunction, TEdgeFunction );
 
       fpaFilterInputMacro( InputLabels, TLabels );
       fpaFilterOutputMacro( OutputProbabilities, TScalarImage );
 
-    public:
-      void AddSeed( const TIndex& seed, const TLabel& label );
+      /* TODO
+         public:
+         void AddSeed( const TIndex& seed, const TLabel& label );
+      */
 
     protected:
       OriginalRandomWalker( );
@@ -90,7 +89,6 @@ namespace fpa
 
       virtual void GenerateData( ) override;
 
-      virtual TScalar _W( const TIndex& i, const TIndex& j );
       virtual TScalar _L( const TIndex& i, const TIndex& j );
 
       // Boundary construction
@@ -161,12 +159,12 @@ namespace fpa
       Self& operator=( const Self& other );
 
     protected:
-      std::vector< TIndex > m_Seeds;
-      std::vector< TLabel > m_Labels;
+      /* TODO
+         std::vector< TIndex > m_Seeds;
+         std::vector< TLabel > m_Labels;
+      */
 
-      TScalar m_Beta;
-      TScalar m_Epsilon;
-      bool m_NormalizeWeights;
+      typename TEdgeFunction::Pointer m_EdgeFunction;
 
       itk::SimpleFastMutexLock m_Mutex;
     };