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