1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Filters__DijkstraBase__h__
6 #define __fpa__Filters__DijkstraBase__h__
9 #include <itkConceptChecking.h>
10 #include <itkFunctionBase.h>
11 #include <fpa/Filters/Algorithm.h>
12 #include <fpa/Functors/BaseVertexFunction.h>
20 template< class _TTraits >
22 : public fpa::Filters::Algorithm< _TTraits >
25 typedef _TTraits TTraits;
26 fpaTraitsMacro( typename, TTraits );
28 typedef fpa::Filters::Algorithm< TTraits > Superclass;
29 typedef DijkstraBase Self;
30 typedef itk::SmartPointer< Self > Pointer;
31 typedef itk::SmartPointer< const Self > ConstPointer;
33 typedef std::vector< TNode > TQueue;
36 bool operator()( const TNode& a, const TNode& b ) const
38 return( b.Value < a.Value );
42 typedef itk::FunctionBase< TOutputValue, TOutputValue > TScalarWeight;
43 typedef fpa::Functors::BaseVertexFunction< TVertex, TOutputValue > TVertexWeight;
48 ( itk::Concept::IsFloatingPoint< TOutputValue > )
52 itkTypeMacro( fpa::Filters::DijkstraBase, fpa::Filters::Algorithm );
54 itkGetConstObjectMacro( ScalarWeight, TScalarWeight );
55 itkGetObjectMacro( ScalarWeight, TScalarWeight );
57 itkGetConstObjectMacro( VertexWeight, TVertexWeight );
58 itkGetObjectMacro( VertexWeight, TVertexWeight );
61 void SetWeightFunction( TScalarWeight* w );
62 void SetWeightFunction( TVertexWeight* w );
66 virtual ~DijkstraBase( );
68 virtual void _UpdateOutputValue( TNode& n ) override;
69 virtual void _QueueClear( ) override;
70 virtual TNode _QueuePop( ) override;
71 virtual void _QueuePush( const TNode& n ) override;
72 virtual unsigned long _QueueSize( ) const override;
73 virtual void _ComputeOutputValue( TNode& n ) override;
76 // Purposely not implemented.
77 DijkstraBase( const Self& other );
78 Self& operator=( const Self& other );
81 typename TScalarWeight::Pointer m_ScalarWeight;
82 typename TVertexWeight::Pointer m_VertexWeight;
85 TQueueOrder m_QueueOrder;
92 #ifndef ITK_MANUAL_INSTANTIATION
93 # include <fpa/Filters/DijkstraBase.hxx>
94 #endif // ITK_MANUAL_INSTANTIATION
96 #endif // __fpa__Filters__DijkstraBase__h__