]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/MinimumSpanningTree.h
...
[FrontAlgorithms.git] / lib / fpa / Image / MinimumSpanningTree.h
index 7d3941d23bbe57d904389af0161cffb74002f20a..a93157cac6acb00c3b4d524f66d12e66981af8db 100644 (file)
@@ -1,8 +1,12 @@
+// =========================================================================
+// @author Leonardo Florez Valencia
+// @email florez-l@javeriana.edu.co
+// =========================================================================
+
 #ifndef __fpa__Image__MinimumSpanningTree__h__
 #define __fpa__Image__MinimumSpanningTree__h__
 
 #include <fpa/Base/MinimumSpanningTree.h>
-#include <cpExtensions/DataStructures/PolyLineParametricPath.h>
 #include <itkImage.h>
 
 namespace fpa
@@ -13,41 +17,47 @@ namespace fpa
      */
     template< unsigned int _VDim >
     class MinimumSpanningTree
-      : public fpa::Base::MinimumSpanningTree< itk::Index< _VDim >, cpExtensions::DataStructures::PolyLineParametricPath< _VDim >, itk::Image< itk::Offset< _VDim >, _VDim > >
+      : public fpa::Base::MinimumSpanningTree< itk::Index< _VDim >, itk::Image< itk::Offset< _VDim >, _VDim > >
     {
     public:
-      typedef itk::Index< _VDim >                               TVertex;
-      typedef cpExtensions::DataStructures::PolyLineParametricPath< _VDim > TPath;
-      typedef itk::Offset< _VDim >                                     TOffset;
-      typedef itk::Image< TOffset, _VDim >                             TImage;
-      typedef fpa::Base::MinimumSpanningTree< TVertex, TPath, TImage > Superclass;
-      typedef MinimumSpanningTree                                      Self;
-      typedef itk::SmartPointer< Self >                                Pointer;
-      typedef itk::SmartPointer< const Self >                          ConstPointer;
+      typedef itk::Index< _VDim > TVertex;
+      typedef itk::Image< itk::Offset< _VDim >, _VDim > TBaseImage;
+
+      typedef MinimumSpanningTree             Self;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+      typedef fpa::Base::MinimumSpanningTree< TVertex, TBaseImage > Superclass;
+
+      typedef typename Superclass::TCollision     TCollision;
+      typedef typename Superclass::TCollisionsRow TCollisionsRow;
+      typedef typename Superclass::TCollisions    TCollisions;
+      typedef typename Superclass::TVertices      TVertices;
 
     public:
       itkNewMacro( Self );
       itkTypeMacro(
-        fpa::Image::MinimumSpanningTree, fpa::Base::MinimumSpanningTree
+        fpa::Image::MinimumSpanningTree,
+        fpa::Base::MinimumSpanningTree
         );
 
     public:
-      virtual TVertex GetParent( const TVertex& v ) const override;
-      virtual void SetParent( const TVertex& v, const TVertex& p ) override;
-
-      virtual void GetPath(
-        typename TPath::Pointer& path, const TVertex& a
-        ) const override;
-      virtual void GetPath(
-        typename TPath::Pointer& path, const TVertex& a, const TVertex& b
-        ) const override;
+      virtual TVertex GetParent( const TVertex& v ) const override
+        {
+          return( v + this->GetPixel( v ) );
+        }
+      virtual void SetParent( const TVertex& v, const TVertex& p ) override
+        {
+          this->SetPixel( v, p - v );
+        }
 
     protected:
-      MinimumSpanningTree( );
-      virtual ~MinimumSpanningTree( );
+      MinimumSpanningTree( )
+        : Superclass( )
+        { }
+      virtual ~MinimumSpanningTree( )
+        { }
 
     private:
-      // Purposely not defined
       MinimumSpanningTree( const Self& other );
       Self& operator=( const Self& other );
     };
@@ -56,10 +66,6 @@ namespace fpa
 
 } // ecapseman
 
-#ifndef ITK_MANUAL_INSTANTIATION
-#  include <fpa/Image/MinimumSpanningTree.hxx>
-#endif // ITK_MANUAL_INSTANTIATION
-
 #endif // __fpa__Image__MinimumSpanningTree__h__
 
 // eof - $RCSfile$