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