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