]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/FastMarching.h
First commit
[FrontAlgorithms.git] / lib / fpa / Base / FastMarching.h
1 #ifndef __FPA__BASE__FASTMARCHING__H__
2 #define __FPA__BASE__FASTMARCHING__H__
3
4 #include <fpa/Base/Dijkstra.h>
5
6 namespace fpa
7 {
8   namespace Base
9   {
10     /**
11      */
12     template< class V, class C, class VV, class VC, class B >
13     class FastMarching
14       : public Dijkstra< V, C, VV, VC, B >
15     {
16     public:
17       // Templated types
18       typedef V  TVertex;
19       typedef C  TCost;
20       typedef VV TVertexValue;
21       typedef B  TBaseFilter;
22
23       // Standard class typdedefs
24       typedef FastMarching                    Self;
25       typedef Dijkstra< V, C, VV, VC, B >     Superclass;
26       typedef itk::SmartPointer< Self >       Pointer;
27       typedef itk::SmartPointer< const Self > ConstPointer;
28
29       typedef typename Superclass::TResult TResult;
30       typedef typename Superclass::TTraits TTraits;
31
32     protected:
33       typedef typename Superclass::_TFrontId _TFrontId;
34       typedef typename Superclass::_TNode    _TNode;
35       typedef typename Superclass::_TNodes   _TNodes;
36       struct _TNodeEikonalSort
37       {
38         bool operator()( const _TNode& a, const _TNode& b ) const
39           { return( a.Result < b.Result ); }
40       };
41
42     public:
43       itkTypeMacro( FastMarching, Dijkstra );
44
45     protected:
46       FastMarching( );
47       virtual ~FastMarching( );
48
49       virtual bool _UpdateNeigh( _TNode& nn, const _TNode& n );
50
51       /**
52        * Eikonal solution method
53        *
54        * This method returns the computed time and a flag indicating if the
55        * determinant was valid.
56        */
57       bool _SolveEikonal( double& re, const _TNode& n, const double& F );
58
59     private:
60       // Purposely not implemented
61       FastMarching( const Self& );
62       void operator=( const Self& );
63
64     protected:
65       static const double LargestValue;
66     };
67
68   } // ecapseman
69
70 } // ecapseman
71
72 #include <fpa/Base/FastMarching.hxx>
73
74 #endif // __FPA__BASE__FASTMARCHING__H__
75
76 // eof - $RCSfile$