X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FBase%2FSeedsInterface.h;h=493b4dbfde30462c9902dde1a12f3a7dbb0e75b5;hb=fe01e92d9bce3519fa2a0936b6180ca7b057a87a;hp=e9c67c3306362f1af8883948445c342129c64654;hpb=c4efafee513539e9a58c4a8b8369450ada1df5d8;p=FrontAlgorithms.git diff --git a/lib/fpa/Base/SeedsInterface.h b/lib/fpa/Base/SeedsInterface.h index e9c67c3..493b4db 100644 --- a/lib/fpa/Base/SeedsInterface.h +++ b/lib/fpa/Base/SeedsInterface.h @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -18,7 +19,7 @@ namespace fpa { /** */ - template< class _TVertex, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare = std::greater< _TVertex > > + template< class _TVertex, class _TPoint, class _TInputValue, class _TOutputValue, class _TFrontId, class _TCompare = std::greater< _TVertex > > class SeedsInterface { public: @@ -29,12 +30,23 @@ namespace fpa public: typedef _TVertex TVertex; + typedef _TPoint TPoint; typedef _TInputValue TInputValue; typedef _TOutputValue TOutputValue; typedef _TFrontId TFrontId; typedef _TCompare TCompare; typedef SeedsInterface Self; + struct TSeed + { + TVertex Vertex; + TPoint Point; + bool IsPoint; + bool IsUnified; + TSeed( ) : IsUnified( false ) { } + }; + typedef std::vector< TSeed > TSeeds; + struct TNode { TVertex Vertex; @@ -52,22 +64,22 @@ namespace fpa return( cmp( a.Vertex, b.Vertex ) ); } }; - typedef std::set< TNode, TNodeCompare > TSeeds; + typedef std::set< TNode, TNodeCompare > TNodes; public: - unsigned int GetNumberOfSeeds( ) const; const TSeeds& GetSeeds( ) const; - typename TSeeds::const_iterator BeginSeeds( ) const; - typename TSeeds::const_iterator EndSeeds( ) const; virtual void AddSeed( const TVertex& seed ); - virtual void RemoveSeed( const TVertex& seed ); + virtual void AddSeed( const TPoint& seed ); virtual void ClearSeeds( ); protected: SeedsInterface( itk::ProcessObject* filter ); virtual ~SeedsInterface( ); + virtual TNodes _UnifySeeds( ) = 0; + virtual void _PrepareSeeds( TNodes& nodes ) = 0; + protected: TSeeds m_Seeds; itk::ProcessObject* m_Filter;