]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Filters/Image/RandomWalker.h
...
[FrontAlgorithms.git] / lib / fpa / Filters / Image / RandomWalker.h
index 41fba2c148fecfa6a8a60630cc75f549b8a4f095..bf5af1142ff466c993baae794fa7fc3c43f183b0 100644 (file)
@@ -10,6 +10,7 @@
 #include <fpa/Filters/Image/Algorithm.h>
 #include <fpa/Filters/Image/DefaultTraits.h>
 #include <fpa/Filters/MarksInterface.h>
+#include <fpa/Filters/Image/LabelsSeedFilter.h>
 #include <fpa/Filters/Image/LabelsSeedInterface.h>
 
 namespace fpa
@@ -40,7 +41,7 @@ namespace fpa
        */
       template< class _TInputImage, class _TInputLabels, class _TCostsImage = itk::Image< float, _TInputImage::ImageDimension >, class _TTraits = fpa::Filters::Image::RandomWalkerTraits< _TInputImage, _TInputLabels, _TCostsImage > >
       class RandomWalker
-        : public fpa::Filters::Image::Algorithm< fpa::Filters::DijkstraBase< _TTraits > >
+        : public fpa::Filters::Image::LabelsSeedFilter< fpa::Filters::Image::Algorithm< fpa::Filters::DijkstraBase< _TTraits > >, _TInputLabels >
       {
       public:
         typedef _TInputImage  TInputImage;
@@ -50,11 +51,11 @@ namespace fpa
         fpaTraitsMacro( typename, TTraits );
 
         typedef fpa::Filters::DijkstraBase< TTraits >        TAlgorithm;
-        typedef fpa::Filters::Image::Algorithm< TAlgorithm > Superclass;
-        typedef RandomWalker                                 Self;
-        typedef itk::SmartPointer< Self >                    Pointer;
-        typedef itk::SmartPointer< const Self >              ConstPointer;
-
+        typedef fpa::Filters::Image::Algorithm< TAlgorithm > TBase;
+        typedef fpa::Filters::Image::LabelsSeedFilter< TBase, TInputLabels > Superclass;
+        typedef RandomWalker                     Self;
+        typedef itk::SmartPointer< Self >        Pointer;
+        typedef itk::SmartPointer< const Self >  ConstPointer;
         typedef typename Superclass::TMarksImage TOutputLabels;
 
       public:
@@ -63,8 +64,6 @@ namespace fpa
           fpa::Filters::Image::RandomWalker, fpa::Filters::Image::Algorithm
           );
 
-        fpaFilterInputMacro( InputLabels, TInputLabels );
-
       public:
         TCostsImage* GetOutputCosts( );
         const TCostsImage* GetOutputCosts( ) const;
@@ -80,16 +79,10 @@ namespace fpa
         RandomWalker( );
         virtual ~RandomWalker( );
 
-        virtual const itk::DataObject* _GetReferenceInput( ) const override;
-        virtual void _PrepareSeeds( const itk::DataObject* input ) override;
-
       private:
         // Purposely not implemented.
         RandomWalker( const Self& other );
         Self& operator=( const Self& other );
-
-      protected:
-        unsigned int m_InputLabelsIdx;
       };
 
     } // ecapseman