]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/MinimumSpanningTree.h
...
[FrontAlgorithms.git] / lib / fpa / Image / MinimumSpanningTree.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5
6 #ifndef __fpa__Image__MinimumSpanningTree__h__
7 #define __fpa__Image__MinimumSpanningTree__h__
8
9 #include <fpa/Base/MinimumSpanningTree.h>
10 #include <itkImage.h>
11
12 namespace fpa
13 {
14   namespace Image
15   {
16     /**
17      */
18     template< unsigned int _VDim >
19     class MinimumSpanningTree
20       : public fpa::Base::MinimumSpanningTree< itk::Index< _VDim >, itk::Image< itk::Offset< _VDim >, _VDim > >
21     {
22     public:
23       typedef itk::Index< _VDim > TVertex;
24       typedef itk::Image< itk::Offset< _VDim >, _VDim > TBaseImage;
25
26       typedef MinimumSpanningTree             Self;
27       typedef itk::SmartPointer< Self >       Pointer;
28       typedef itk::SmartPointer< const Self > ConstPointer;
29       typedef fpa::Base::MinimumSpanningTree< TVertex, TBaseImage > Superclass;
30
31       typedef typename Superclass::TCollision     TCollision;
32       typedef typename Superclass::TCollisionsRow TCollisionsRow;
33       typedef typename Superclass::TCollisions    TCollisions;
34       typedef typename Superclass::TVertices      TVertices;
35
36     public:
37       itkNewMacro( Self );
38       itkTypeMacro(
39         fpa::Image::MinimumSpanningTree,
40         fpa::Base::MinimumSpanningTree
41         );
42
43     public:
44       virtual TVertex GetParent( const TVertex& v ) const override
45         {
46           return( v + this->GetPixel( v ) );
47         }
48       virtual void SetParent( const TVertex& v, const TVertex& p ) override
49         {
50           this->SetPixel( v, p - v );
51         }
52
53     protected:
54       MinimumSpanningTree( )
55         : Superclass( )
56         { }
57       virtual ~MinimumSpanningTree( )
58         { }
59
60     private:
61       MinimumSpanningTree( const Self& other );
62       Self& operator=( const Self& other );
63     };
64
65   } // ecapseman
66
67 } // ecapseman
68
69 #endif // __fpa__Image__MinimumSpanningTree__h__
70
71 // eof - $RCSfile$