]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/ExtractBranchesFromMinimumSpanningTree.h
06c304607d4317ce7d8eb63c6104878631640fe0
[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
8 namespace fpa
9 {
10   namespace Base
11   {
12     /**
13      */
14     template< class T >
15     class ExtractBranchesFromMinimumSpanningTree
16       : public itk::ProcessObject
17     {
18     public:
19       typedef ExtractBranchesFromMinimumSpanningTree Self;
20       typedef itk::ProcessObject                     Superclass;
21       typedef itk::SmartPointer< Self >              Pointer;
22       typedef itk::SmartPointer< const Self >        ConstPointer;
23
24       typedef T                          TMinimumSpanningTree;
25       typedef typename T::TVertex        TVertex;
26       typedef typename T::TVertexCompare TVertexCompare;
27       typedef
28       fpa::Base::MatrixValuesContainer< TVertex, bool, TVertexCompare >
29       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$