]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/ImageSkeleton.h
...
[FrontAlgorithms.git] / lib / fpa / Base / ImageSkeleton.h
1 #ifndef __FPA__BASE__IMAGESKELETON__H__
2 #define __FPA__BASE__IMAGESKELETON__H__
3
4 #include <itkSimpleDataObjectDecorator.h>
5 #include <cpExtensions/DataStructures/PolyLineParametricPath.h>
6
7 namespace fpa
8 {
9   namespace Base
10   {
11     /**
12      */
13     template< class _TMST >
14     class ImageSkeleton
15       : public itk::SimpleDataObjectDecorator< std::map< typename _TMST::TVertex, std::map< typename _TMST::TVertex, typename cpExtensions::DataStructures::PolyLineParametricPath< _TMST::TVertex::Dimension >::Pointer, typename _TMST::TVertex::LexicographicCompare >, typename _TMST::TVertex::LexicographicCompare > >
16     {
17     public:
18       // Base types
19       typedef _TMST                                  TMinimumSpanningTree;
20       typedef typename _TMST::TVertex                TVertex;
21       typedef typename TVertex::LexicographicCompare TVertexCmp;
22       typedef
23       cpExtensions::DataStructures::PolyLineParametricPath< TVertex::Dimension >
24       TPath;
25       typedef
26       std::map< TVertex, typename TPath::Pointer, TVertexCmp >
27       TSkeletonRow;
28       typedef std::map< TVertex, TSkeletonRow, TVertexCmp > TSkeleton;
29
30       // ITK-related types
31       typedef ImageSkeleton                               Self;
32       typedef itk::SimpleDataObjectDecorator< TSkeleton > Superclass;
33       typedef itk::SmartPointer< Self >                   Pointer;
34       typedef itk::SmartPointer< const Self >             ConstPointer;
35
36     public:
37       itkNewMacro( Self );
38       itkTypeMacro( ImageSkeleton, itk::SimpleDataObjectDecorator );
39
40       itkGetConstObjectMacro( MinimumSpanningTree, _TMST );
41       itkSetConstObjectMacro( MinimumSpanningTree, _TMST );
42
43     public:
44       void AddBranch( const TVertex& a, const TVertex& b );
45       const TPath* GetBranch( const TVertex& a, const TVertex& b ) const;
46
47     protected:
48       ImageSkeleton( );
49       virtual ~ImageSkeleton( );
50
51     private:
52       // Purposely not implemented
53       ImageSkeleton( const Self& other );
54       Self& operator=( const Self& other );
55
56     protected:
57       typename _TMST::ConstPointer m_MinimumSpanningTree;
58     };
59
60   } // ecapseman
61
62 } // ecapseman
63
64 #ifndef ITK_MANUAL_INSTANTIATION
65 #include <fpa/Base/ImageSkeleton.hxx>
66 #endif // ITK_MANUAL_INSTANTIATION
67
68 #endif // __FPA__BASE__IMAGESKELETON__H__
69
70 // eof - $RCSfile$