1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Base__Dijkstra__h__
7 #define __fpa__Base__Dijkstra__h__
9 #include <itkFunctionBase.h>
10 #include <fpa/Base/MinimumSpanningTree.h>
11 #include <fpa/Base/Functors/VertexParentBase.h>
19 template< class _TFilter, class _TMarksInterface, class _TSeedsInterface, class _TMST >
22 public _TMarksInterface,
23 public _TSeedsInterface
26 typedef Dijkstra Self;
27 typedef _TFilter Superclass;
28 typedef _TMarksInterface TMarksInterface;
29 typedef _TSeedsInterface TSeedsInterface;
31 typedef itk::SmartPointer< Self > Pointer;
32 typedef itk::SmartPointer< const Self > ConstPointer;
34 typedef typename Superclass::TInputValue TInputValue;
35 typedef typename Superclass::TOutputValue TOutputValue;
36 typedef typename Superclass::TVertex TVertex;
37 typedef typename Superclass::TVertices TVertices;
39 typedef itk::FunctionBase< TInputValue, TOutputValue > TIntensityFunctor;
40 typedef fpa::Base::Functors::VertexParentBase< TVertex, TOutputValue > TVertexFunctor;
48 unsigned long FrontId;
49 _TNode( const TVertex& v, const TVertex& p, const unsigned long& fId )
54 this->Cost = TOutputValue( 0 );
56 bool operator<( const _TNode& b ) const
58 return( b.Cost < this->Cost );
63 itkTypeMacro( Dijkstra, TFilter );
66 TMST* GetMinimumSpanningTree( );
67 const TMST* GetMinimumSpanningTree( ) const;
69 const TIntensityFunctor* GetIntensityFunctor( ) const;
70 const TVertexFunctor* GetVertexFunctor( ) const;
72 void SetFunctor( TIntensityFunctor* functor );
73 void SetFunctor( TVertexFunctor* functor );
79 virtual void GenerateData( ) override;
82 Dijkstra( const Self& other );
83 Self& operator=( const Self& other );
86 typename TIntensityFunctor::Pointer m_IntensityFunctor;
87 typename TVertexFunctor::Pointer m_VertexFunctor;
88 unsigned long m_MSTIndex;
95 #ifndef ITK_MANUAL_INSTANTIATION
96 # include <fpa/Base/Dijkstra.hxx>
97 #endif // ITK_MANUAL_INSTANTIATION
99 #endif // __fpa__Base__Dijkstra__h__