]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/MinimumSpanningTree.h
22f7904f5b28549cbf5c619076ee06ffdfe69c50
[FrontAlgorithms.git] / lib / fpa / Image / MinimumSpanningTree.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5
6 #ifndef __fpa__Image__MinimumSpanningTree__h__
7 #define __fpa__Image__MinimumSpanningTree__h__
8
9 #include <fpa/Base/MinimumSpanningTree.h>
10 #include <itkImage.h>
11 #include <fpa/Image/PolyLineParametricPath.h>
12
13 namespace fpa
14 {
15   namespace Image
16   {
17     /**
18      */
19     template< unsigned int _VDim >
20     class MinimumSpanningTree
21       : public fpa::Base::MinimumSpanningTree< itk::Index< _VDim >, itk::Image< itk::Offset< _VDim >, _VDim > >
22     {
23     public:
24       typedef itk::Index< _VDim > TVertex;
25       typedef itk::Image< itk::Offset< _VDim >, _VDim > TBaseImage;
26
27       typedef MinimumSpanningTree             Self;
28       typedef itk::SmartPointer< Self >       Pointer;
29       typedef itk::SmartPointer< const Self > ConstPointer;
30       typedef fpa::Base::MinimumSpanningTree< TVertex, TBaseImage > Superclass;
31
32       typedef typename Superclass::TCollision     TCollision;
33       typedef typename Superclass::TCollisionsRow TCollisionsRow;
34       typedef typename Superclass::TCollisions    TCollisions;
35       typedef typename Superclass::TVertices      TVertices;
36
37       typedef fpa::Image::PolyLineParametricPath< _VDim > TPolyLineParametricPath;
38
39     public:
40       itkNewMacro( Self );
41       itkTypeMacro(
42         fpa::Image::MinimumSpanningTree,
43         fpa::Base::MinimumSpanningTree
44         );
45
46     public:
47       virtual TVertex GetParent( const TVertex& v ) const override;
48       virtual void SetParent( const TVertex& v, const TVertex& p ) override;
49
50       void GetPolyLineParametricPath(
51         typename TPolyLineParametricPath::Pointer& path,
52         const TVertex& a
53         ) const;
54       void GetPolyLineParametricPath(
55         typename TPolyLineParametricPath::Pointer& path,
56         const TVertex& a, const TVertex& b
57         ) const;
58
59     protected:
60       MinimumSpanningTree( );
61       virtual ~MinimumSpanningTree( );
62
63     private:
64       MinimumSpanningTree( const Self& other );
65       Self& operator=( const Self& other );
66     };
67
68   } // ecapseman
69
70 } // ecapseman
71
72 #ifndef ITK_MANUAL_INSTANTIATION
73 #  include <fpa/Image/MinimumSpanningTree.hxx>
74 #endif // ITK_MANUAL_INSTANTIATION
75
76 #endif // __fpa__Image__MinimumSpanningTree__h__
77
78 // eof - $RCSfile$