#ifndef __fpa__Base__SeedsInterface__h__
#define __fpa__Base__SeedsInterface__h__
-#include <itkProcessObject.h>
+#include <functional>
#include <set>
+#include <itkConceptChecking.h>
+#include <itkProcessObject.h>
+
namespace fpa
{
namespace Base
{
/**
*/
- template< class _TVertex, class _TCompare >
+ template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare = std::greater< _TVertex > >
class SeedsInterface
{
public:
- typedef _TVertex TVertex;
- typedef _TCompare TCompare;
+ itkConceptMacro(
+ Check_TFrontId,
+ ( itk::Concept::IsUnsignedInteger< _TFrontId > )
+ );
+
+ public:
+ typedef _TVertex TVertex;
+ typedef _TInputValue TInputValue;
+ typedef _TOutputValue TOutputValue;
+ typedef _TFrontId TFrontId;
+ typedef _TCompare TCompare;
typedef SeedsInterface Self;
- typedef std::set< TVertex, TCompare > TSeeds;
+
+ struct TNode
+ {
+ TVertex Vertex;
+ TVertex Parent;
+ TFrontId FrontId;
+
+ // Hack to hide the fact that seed values need to be initialized
+ mutable TOutputValue Value;
+ };
+ struct TNodeCompare
+ {
+ bool operator()( const TNode& a, const TNode& b ) const
+ {
+ TCompare cmp;
+ return( cmp( a.Vertex, b.Vertex ) );
+ }
+ };
+ typedef std::set< TNode, TNodeCompare > TSeeds;
public:
unsigned int GetNumberOfSeeds( ) const;
typename TSeeds::const_iterator BeginSeeds( ) const;
typename TSeeds::const_iterator EndSeeds( ) const;
- void AddSeed( const TVertex& seed );
- void RemoveSeed( const TVertex& seed );
- void ClearSeeds( );
+ virtual void AddSeed( const TVertex& seed );
+ virtual void RemoveSeed( const TVertex& seed );
+ virtual void ClearSeeds( );
protected:
SeedsInterface( itk::ProcessObject* filter );
virtual ~SeedsInterface( );
- private:
+ protected:
TSeeds m_Seeds;
itk::ProcessObject* m_Filter;
};