]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/ExtractBranchesFromMinimumSpanningTree.h
...
[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/VectorValuesContainer.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 std::set< TVertex, TVertexCompare >          TEndPoints;
30
31       typedef
32       fpa::Base::VectorValuesContainer< typename TPath::Pointer >
33       TBranches;
34
35     public:
36       itkNewMacro( Self );
37       itkTypeMacro(
38         ExtractBranchesFromMinimumSpanningTree,
39         itk::ProcessObject
40         );
41
42     public:
43       const T* GetInput( ) const;
44       void SetInput( const T* tree );
45
46       TPath* GetOutput( );
47
48       void ClearEndPoints( );
49       void AddEndPoint( const TVertex& v );
50       bool HasEndPoint( const TVertex& v ) const;
51       unsigned long GetNumberOfEndPoints( ) const;
52
53     protected:
54       ExtractBranchesFromMinimumSpanningTree( );
55       virtual ~ExtractBranchesFromMinimumSpanningTree( );
56
57       virtual void GenerateData( );
58
59     private:
60       // Purposely not implemented
61       ExtractBranchesFromMinimumSpanningTree( const Self& other );
62       Self& operator=( const Self& other );
63
64     protected:
65       TEndPoints m_EndPoints;
66     };
67
68   } // ecapseman
69
70 } // ecapseman
71
72 #include <fpa/Base/ExtractBranchesFromMinimumSpanningTree.hxx>
73
74 #endif // __FPA__BASE__EXTRACTBRANCHESFROMMINIMUMSPANNINGTREE__H__
75
76 // eof - $RCSfile$