]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/DataStructures/Skeleton.h
671b8acc529f282c7fd1427dddb5d497ec1d1a25
[cpPlugins.git] / lib / cpExtensions / DataStructures / Skeleton.h
1 #ifndef __cpExtensions__DataStructures__Skeleton__h__
2 #define __cpExtensions__DataStructures__Skeleton__h__
3
4 #include <cpExtensions/DataStructures/Graph.h>
5 #include <cpExtensions/DataStructures/PolyLineParametricPath.h>
6 #include <vector>
7
8 namespace cpExtensions
9 {
10   namespace DataStructures
11   {
12     /**
13      */
14     template< unsigned int _VDim >
15     class Skeleton
16       : public Graph< typename PolyLineParametricPath< _VDim >::TIndex, typename PolyLineParametricPath< _VDim >::Pointer, typename PolyLineParametricPath< _VDim >::TIndex, typename PolyLineParametricPath< _VDim >::TIndex::LexicographicCompare >
17     {
18     public:
19       typedef PolyLineParametricPath< _VDim >       TPath;
20       typedef typename TPath::TIndex                TIndex;
21       typedef typename TIndex::LexicographicCompare TIndexCompare;
22       typedef typename TPath::Pointer TPathPointer;
23
24       itkStaticConstMacro( Dimension, unsigned int, _VDim );
25
26       typedef Graph< TIndex, TPathPointer, TIndex, TIndexCompare > Superclass;
27       typedef Skeleton                        Self;
28       typedef itk::SmartPointer< Self >       Pointer;
29       typedef itk::SmartPointer< const Self > ConstPointer;
30
31     public:
32       itkNewMacro( Self );
33       itkTypeMacro( Skeleton, Graph );
34
35     public:
36       void AddBranch( TPath* path );
37       const TPath* GetBranch( const TIndex& a, const TIndex& b ) const;
38
39       std::vector< TIndex > GetEndPoints( ) const;
40       std::vector< TIndex > GetBifurcations( ) const;
41
42     protected:
43       Skeleton( );
44       virtual ~Skeleton( );
45
46     private:
47       // Purposely not implemented
48       Skeleton( const Self& other );
49       Self& operator=( const Self& other );
50     };
51
52   } // ecapseman
53
54 } // ecapseman
55
56 #ifndef ITK_MANUAL_INSTANTIATION
57 #  include <cpExtensions/DataStructures/Skeleton.hxx>
58 #endif // ITK_MANUAL_INSTANTIATION
59
60 #endif // __cpExtensions__DataStructures__Skeleton__h__
61
62 // eof - $RCSfile$