]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.h
...
[FrontAlgorithms.git] / lib / fpa / Base / ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.h
1 #ifndef __FPA__BASE__EXTRACTENDPOINTSANDBIFURCATIONSFROMMINIMUMSPANNINGTREE__H__
2 #define __FPA__BASE__EXTRACTENDPOINTSANDBIFURCATIONSFROMMINIMUMSPANNINGTREE__H__
3
4 #include <utility>
5 #include <vector>
6 #include <itkProcessObject.h>
7 #include <itkSimpleDataObjectDecorator.h>
8 #include <cpExtensions/DataStructures/ImageIndexesContainer.h>
9
10 namespace fpa
11 {
12   namespace Base
13   {
14     /**
15      */
16     template< class _TMST >
17     class ExtractEndPointsAndBifurcationsFromMinimumSpanningTree
18       : public itk::ProcessObject
19     {
20     public:
21       typedef ExtractEndPointsAndBifurcationsFromMinimumSpanningTree Self;
22       typedef itk::ProcessObject                                     Superclass;
23       typedef itk::SmartPointer< Self >                              Pointer;
24       typedef itk::SmartPointer< const Self >                        ConstPointer;
25
26       typedef _TMST  TMinimumSpanningTree;
27       typedef typename _TMST::TVertex       TVertex;
28       typedef std::pair< TVertex, TVertex > TBranch;
29       typedef std::vector< TBranch >        TBranches;
30
31       typedef
32       cpExtensions::DataStructures::ImageIndexesContainer< TVertex::Dimension >
33       TVertices;
34
35     public:
36       itkTypeMacro(
37         ExtractEndPointsAndBifurcationsFromMinimumSpanningTree,
38         itk::ProcessObject
39         );
40
41     public:
42       const TMinimumSpanningTree* GetMinimumSpanningTree( );
43       void SetMinimumSpanningTree( TMinimumSpanningTree* mst );
44
45       TVertices* GetEndPoints( );
46       TVertices* GetBifurcations( );
47       TVertices* GetCollisions( );
48
49       virtual void Update( ) ITK_OVERRIDE
50         {
51           this->GenerateData( );
52         }
53
54     protected:
55       ExtractEndPointsAndBifurcationsFromMinimumSpanningTree( );
56       virtual ~ExtractEndPointsAndBifurcationsFromMinimumSpanningTree( );
57
58       virtual void GenerateData( ) ITK_OVERRIDE;
59
60       virtual void _MarkSkeleton(
61         const TVertex& v, const unsigned long& l
62         ) = 0;
63       virtual void _MarkSphere(
64         const TVertex& v,
65         const double& r,
66         const unsigned long& l
67         ) = 0;
68       virtual unsigned long _Mark( const TVertex& v ) = 0;
69       virtual unsigned long _SkeletonMark( const TVertex& v ) = 0;
70       virtual double _Radius( const TVertex& v ) = 0;
71
72       virtual void _Tmp( ) = 0;
73
74     private:
75       // Purposely not implemented
76       ExtractEndPointsAndBifurcationsFromMinimumSpanningTree( const Self& other );
77       Self& operator=( const Self& other );
78
79     protected:
80       TBranches m_Branches;
81     };
82
83   } // ecapseman
84
85 } // ecapseman
86
87 #ifndef ITK_MANUAL_INSTANTIATION
88 #include <fpa/Base/ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.hxx>
89 #endif // ITK_MANUAL_INSTANTIATION
90
91 #endif // __FPA__BASE__EXTRACTENDPOINTSANDBIFURCATIONSFROMMINIMUMSPANNINGTREE__H__
92
93 // eof - $RCSfile$