#define __fpa__Base__Dijkstra__h__
#include <itkFunctionBase.h>
+#include <fpa/Base/MinimumSpanningTree.h>
+#include <fpa/Base/Functors/VertexParentBase.h>
namespace fpa
{
{
/**
*/
- template< class _TFilter, class _TMarksInterface, class _TSeedsInterface >
+ template< class _TFilter, class _TMarksInterface, class _TSeedsInterface, class _TMST >
class Dijkstra
: public _TFilter,
public _TMarksInterface,
typedef _TFilter Superclass;
typedef _TMarksInterface TMarksInterface;
typedef _TSeedsInterface TSeedsInterface;
+ typedef _TMST TMST;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
typedef typename Superclass::TVertices TVertices;
typedef itk::FunctionBase< TInputValue, TOutputValue > TIntensityFunctor;
- typedef itk::FunctionBase< TVertex, TOutputValue > TVertexFunctor;
+ typedef fpa::Base::Functors::VertexParentBase< TVertex, TOutputValue > TVertexFunctor;
protected:
struct _TNode
TVertex Vertex;
TVertex Parent;
TOutputValue Cost;
- _TNode( const TVertex& v, const TVertex& p )
+ unsigned long FrontId;
+ _TNode( const TVertex& v, const TVertex& p, const unsigned long& fId )
{
this->Vertex = v;
this->Parent = p;
+ this->FrontId = fId;
this->Cost = TOutputValue( 0 );
}
bool operator<( const _TNode& b ) const
{
- return( this->Cost < b.Cost );
+ return( b.Cost < this->Cost );
}
};
itkTypeMacro( Dijkstra, TFilter );
public:
+ TMST* GetMinimumSpanningTree( );
+ const TMST* GetMinimumSpanningTree( ) const;
+
const TIntensityFunctor* GetIntensityFunctor( ) const;
const TVertexFunctor* GetVertexFunctor( ) const;
protected:
typename TIntensityFunctor::Pointer m_IntensityFunctor;
typename TVertexFunctor::Pointer m_VertexFunctor;
+ unsigned long m_MSTIndex;
};
} // ecapseman