]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/ExtractBranchesFromMinimumSpanningTree.h
183a7fa2774e5e1dcb6886574b65a69c0f32a0c8
[FrontAlgorithms.git] / lib / fpa / Base / ExtractBranchesFromMinimumSpanningTree.h
1 #ifndef __FPA__BASE__EXTRACTBRANCHESFROMMINIMUMSPANNINGTREE__H__
2 #define __FPA__BASE__EXTRACTBRANCHESFROMMINIMUMSPANNINGTREE__H__
3
4 #include <set>
5 #include <fpa/Base/MatrixValuesContainer.h>
6 #include <itkProcessObject.h>
7 #include <itkPolyLineParametricPath.h>
8
9 namespace fpa
10 {
11   namespace Base
12   {
13     /**
14      */
15     template< class T >
16     class ExtractBranchesFromMinimumSpanningTree
17       : public itk::ProcessObject
18     {
19     public:
20       typedef ExtractBranchesFromMinimumSpanningTree Self;
21       typedef itk::ProcessObject                     Superclass;
22       typedef itk::SmartPointer< Self >              Pointer;
23       typedef itk::SmartPointer< const Self >        ConstPointer;
24
25       typedef T                          TMinimumSpanningTree;
26       typedef typename T::TVertex        TVertex;
27       typedef typename T::TVertexCompare TVertexCompare;
28       typedef itk::PolyLineParametricPath< TVertex::Dimension >  TPath;
29       typedef fpa::Base::MatrixValuesContainer< TVertex, typename TPath::Pointer, TVertexCompare > TBranches;
30
31       typedef std::set< TVertex, TVertexCompare > TEndPoints;
32
33     public:
34       itkNewMacro( Self );
35       itkTypeMacro(
36         ExtractBranchesFromMinimumSpanningTree,
37         itk::ProcessObject
38         );
39
40     public:
41       const T* GetInput( ) const;
42       void SetInput( const T* tree );
43
44       TBranches* GetOutput( );
45
46       void ClearEndPoints( );
47       void AddEndPoint( const TVertex& v );
48       bool HasEndPoint( const TVertex& v ) const;
49       unsigned long GetNumberOfEndPoints( ) const;
50
51     protected:
52       ExtractBranchesFromMinimumSpanningTree( );
53       virtual ~ExtractBranchesFromMinimumSpanningTree( );
54
55       virtual void GenerateData( );
56
57     private:
58       // Purposely not implemented
59       ExtractBranchesFromMinimumSpanningTree( const Self& other );
60       Self& operator=( const Self& other );
61
62     protected:
63       TEndPoints m_EndPoints;
64     };
65
66   } // ecapseman
67
68 } // ecapseman
69
70 #include <fpa/Base/ExtractBranchesFromMinimumSpanningTree.hxx>
71
72 #endif // __FPA__BASE__EXTRACTBRANCHESFROMMINIMUMSPANNINGTREE__H__
73
74 // eof - $RCSfile$