]> Creatis software - FrontAlgorithms.git/commitdiff
...
authorLeonardo Flórez-Valencia <leonardo.florez@gmail.com>
Wed, 19 Jul 2017 02:19:54 +0000 (21:19 -0500)
committerLeonardo Flórez-Valencia <leonardo.florez@gmail.com>
Wed, 19 Jul 2017 02:19:54 +0000 (21:19 -0500)
lib/fpa/Image/RandomWalker.h
lib/fpa/Image/RandomWalker.hxx

index aba7d84ba14075b94fe667ea52f89736d7ba4323..98b949203b863a5984f4182373b57e1bbd508ce8 100644 (file)
@@ -12,6 +12,7 @@
 #include <fpa/Image/Algorithm.h>
 #include <fpa/Image/DefaultTraits.h>
 #include <fpa/Image/LabelledSeedsInterface.h>
+#include <fpa/Image/Functors/Dijkstra/Function.h>
 
 namespace fpa
 {
@@ -67,34 +68,25 @@ namespace fpa
     template< class _TInputImage, class _TLabelImage, class _TScalar >
     class RandomWalker
       : public fpa::Base::DijkstraBase< fpa::Image::Algorithm< fpa::Image::RandomWalkerTraits< _TInputImage, _TLabelImage, _TScalar > > >
-        /* TODO
-           : public fpa::Base::DijkstraBase< fpa::Image::Algorithm< _TInputImage, itk::Image< _TScalar, _TInputImage::ImageDimension >, fpa::Base::MarksInterface< typename _TInputImage::IndexType >, fpa::Image::LabelledSeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::PointType, typename _TInputImage::PixelType, _TScalar, typename _TLabelImage::PixelType, typename _TInputImage::IndexType::LexicographicCompare > > >
-        */
     {
     public:
-      /* TODO
-         typedef _TInputImage TInputImage;
-         typedef _TLabelImage TLabelImage;
-         typedef _TScalar     TScalar;
-         typedef typename TInputImage::IndexType        TVertex;
-         typedef typename TInputImage::PointType        TPoint;
-         typedef typename TVertex::LexicographicCompare TVertexCompare;
-         typedef typename TInputImage::PixelType        TInputValue;
-         typedef typename TLabelImage::PixelType        TFrontId;
-
-         typedef itk::Image< TScalar, _TInputImage::ImageDimension > TOutputImage;
-         typedef fpa::Base::MarksInterface< TVertex > TMarksInterface;
-         typedef fpa::Image::LabelledSeedsInterface< TVertex, TPoint, TInputValue, _TScalar, TFrontId, TVertexCompare > TSeedsInterface;
-         typedef fpa::Image::Algorithm< _TInputImage, TOutputImage, TMarksInterface, TSeedsInterface > TAlgorithm;
-         typedef RandomWalker                          Self;
-         typedef fpa::Base::DijkstraBase< TAlgorithm > Superclass;
-         typedef itk::SmartPointer< Self >             Pointer;
-         typedef itk::SmartPointer< const Self >       ConstPointer;
-
-         typedef fpa::Image::Functors::Dijkstra::Function< TInputImage, TScalar > TWeightFunction;
-         typedef typename TSeedsInterface::TNode  TNode;
-         typedef typename TSeedsInterface::TNodes TNodes;
-      */
+      typedef _TInputImage TInputImage;
+      typedef _TLabelImage TLabelImage;
+      typedef _TScalar     TScalar;
+
+      typedef fpa::Image::RandomWalkerTraits< TInputImage, TLabelImage, TScalar > TTraits;
+      typedef fpa::Image::Algorithm< TTraits > TAlgorithm;
+      typedef fpa::Base::DijkstraBase< TAlgorithm > Superclass;
+      typedef RandomWalker                    Self;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef typename TTraits::TNode   TNode;
+      typedef typename TTraits::TNodes  TNodes;
+      typedef typename TTraits::TSeed   TSeed;
+      typedef typename TTraits::TVertex TVertex;
+
+      typedef fpa::Image::Functors::Dijkstra::Function< TInputImage, TScalar > TWeightFunction;
 
     public:
       itkNewMacro( Self );
index 21abc08f617cf5aede6f97a1b71c803f1314a71f..6935abfd216ffc068e3b6943db7eb05ba5683945 100644 (file)
@@ -102,7 +102,7 @@ _UnifySeeds( )
 
       if( !is_seed )
       {
-        typename TSeedsInterface::TNode node;
+        TNode node;
         node.Vertex = lIt.GetIndex( );
         node.Parent = lIt.GetIndex( );
         node.FrontId = lIt.Get( );
@@ -112,7 +112,7 @@ _UnifySeeds( )
       }
       else
       {
-        typename TSeedsInterface::TSeed seed;
+        TSeed seed;
         seed.Vertex = lIt.GetIndex( );
         seed.IsPoint = false;
         seed.FrontId = lIt.Get( );