]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/MinimumSpanningTree.h
...
[FrontAlgorithms.git] / lib / fpa / Base / MinimumSpanningTree.h
index de22019b3e6595ebe9aa147c1aef692cad2e1c0d..03940f140a18300af6866b9b9b1ffbb519600f48 100644 (file)
@@ -2,7 +2,6 @@
 #define __fpa__Base__MinimumSpanningTree__h__
 
 #include <fpa/Config.h>
-#include <deque>
 #include <vector>
 #include <utility>
 #include <itkObject.h>
@@ -13,7 +12,7 @@ namespace fpa
   {
     /**
      */
-    template< class _TVertex, class _TSuperclass >
+    template< class _TVertex, class _TPath, class _TSuperclass >
     class MinimumSpanningTree
       : public _TSuperclass
     {
@@ -24,7 +23,7 @@ namespace fpa
       typedef itk::SmartPointer< const Self > ConstPointer;
 
       typedef _TVertex                      TVertex;
-      typedef std::deque< _TVertex >        TVertices;
+      typedef _TPath                        TPath;
       typedef std::pair< _TVertex, bool >   TCollision;
       typedef std::vector< TCollision >     TCollisionsRow;
       typedef std::vector< TCollisionsRow > TCollisions;
@@ -46,8 +45,12 @@ namespace fpa
       virtual _TVertex GetParent( const _TVertex& v ) const = 0;
       virtual void SetParent( const _TVertex& v, const _TVertex& p ) = 0;
 
-      virtual TVertices GetPath( const _TVertex& a ) const;
-      virtual TVertices GetPath( const _TVertex& a, const _TVertex& b ) const;
+      virtual void GetPath(
+        typename _TPath::Pointer& path, const _TVertex& a
+        ) const;
+      virtual void GetPath(
+        typename _TPath::Pointer& path, const _TVertex& a, const _TVertex& b
+        ) const;
 
     protected:
       MinimumSpanningTree( );
@@ -61,7 +64,7 @@ namespace fpa
     protected:
       TCollisions m_Collisions;
       _TMatrix    m_FrontPaths;
-      TVertices   m_Seeds;
+      std::vector< _TVertex > m_Seeds;
     };
 
   } // ecapseman