X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FImage%2FMinimumSpanningTree.h;h=371664c3b10b9e7e0eca1f9b89b5f917086e70ef;hb=3f4722ccf68d830e26dac9b945925efa68e39e4c;hp=652547d62debf33c7ecb79d27d809f5f54efb4a6;hpb=db33ebb226fd58f493b7db245fc8b807f895ee6e;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/MinimumSpanningTree.h b/lib/fpa/Image/MinimumSpanningTree.h index 652547d..371664c 100644 --- a/lib/fpa/Image/MinimumSpanningTree.h +++ b/lib/fpa/Image/MinimumSpanningTree.h @@ -1,8 +1,8 @@ -#ifndef __FPA__IMAGE__MINIMUMSPANNINGTREE__H__ -#define __FPA__IMAGE__MINIMUMSPANNINGTREE__H__ +#ifndef __fpa__Image__MinimumSpanningTree__h__ +#define __fpa__Image__MinimumSpanningTree__h__ -#include #include +#include namespace fpa { @@ -10,35 +10,42 @@ namespace fpa { /** */ - template< class V, class N, class C, unsigned int D, unsigned long L > + template< unsigned int _VDim > class MinimumSpanningTree - : public fpa::Base::MinimumSpanningTree< V, C, itk::Image< N, D > > + : public fpa::Base::MinimumSpanningTree< itk::Index< _VDim >, itk::Image< itk::Offset< _VDim >, _VDim > > { public: - typedef fpa::Base::MinimumSpanningTree< V, C, itk::Image< N, D > > Superclass; - typedef MinimumSpanningTree Self; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - typedef V TVertex; - typedef C TCollisions; - - protected: - typedef N _TNode; + typedef itk::Index< _VDim > TVertex; + typedef itk::Offset< _VDim > TOffset; + typedef itk::Image< TOffset, _VDim > TImage; + typedef fpa::Base::MinimumSpanningTree< TVertex, TImage > Superclass; + typedef MinimumSpanningTree Self; + typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer< const Self > ConstPointer; + + typedef typename Superclass::TVertices TVertices; + typedef typename TImage::PointType TPoint; + typedef std::deque< TPoint > TPoints; public: itkNewMacro( Self ); - itkTypeMacro( MinimumSpanningTree, fpa_Base_MinimumSpanningTree ); + itkTypeMacro( + fpa::Image::MinimumSpanningTree, fpa::Base::MinimumSpanningTree + ); + + public: + virtual TVertex GetParent( const TVertex& v ) const fpa_OVERRIDE; + virtual void SetParent( const TVertex& v, const TVertex& p ) fpa_OVERRIDE; + + TPoints GetEuclideanPath( const TVertex& a ) const; + TPoints GetEuclideanPath( const TVertex& a, const TVertex& b ) const; protected: MinimumSpanningTree( ); virtual ~MinimumSpanningTree( ); - virtual long _FrontId( const V& v ) const; - virtual V _Parent( const V& v ) const; - private: - // Purposely not implemented + // Purposely not defined MinimumSpanningTree( const Self& other ); Self& operator=( const Self& other ); }; @@ -47,8 +54,10 @@ namespace fpa } // ecapseman -#include +#ifndef ITK_MANUAL_INSTANTIATION +# include +#endif // ITK_MANUAL_INSTANTIATION -#endif // __FPA__IMAGE__MINIMUMSPANNINGTREE__H__ +#endif // __fpa__Image__MinimumSpanningTree__h__ // eof - $RCSfile$