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