X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FImage%2FMinimumSpanningTree.h;h=a93157cac6acb00c3b4d524f66d12e66981af8db;hb=e8b46a839b86641f48f593d021234566877ac683;hp=371664c3b10b9e7e0eca1f9b89b5f917086e70ef;hpb=ea46079b5aef76c1782648ed23e70ea944649635;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/MinimumSpanningTree.h b/lib/fpa/Image/MinimumSpanningTree.h index 371664c..a93157c 100644 --- a/lib/fpa/Image/MinimumSpanningTree.h +++ b/lib/fpa/Image/MinimumSpanningTree.h @@ -1,3 +1,8 @@ +// ========================================================================= +// @author Leonardo Florez Valencia +// @email florez-l@javeriana.edu.co +// ========================================================================= + #ifndef __fpa__Image__MinimumSpanningTree__h__ #define __fpa__Image__MinimumSpanningTree__h__ @@ -15,37 +20,44 @@ namespace fpa : public fpa::Base::MinimumSpanningTree< itk::Index< _VDim >, itk::Image< itk::Offset< _VDim >, _VDim > > { public: - 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; + typedef itk::Index< _VDim > TVertex; + typedef itk::Image< itk::Offset< _VDim >, _VDim > TBaseImage; + + typedef MinimumSpanningTree Self; + typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer< const Self > ConstPointer; + typedef fpa::Base::MinimumSpanningTree< TVertex, TBaseImage > Superclass; + + typedef typename Superclass::TCollision TCollision; + typedef typename Superclass::TCollisionsRow TCollisionsRow; + typedef typename Superclass::TCollisions TCollisions; + typedef typename Superclass::TVertices TVertices; public: itkNewMacro( Self ); itkTypeMacro( - fpa::Image::MinimumSpanningTree, fpa::Base::MinimumSpanningTree + 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; + virtual TVertex GetParent( const TVertex& v ) const override + { + return( v + this->GetPixel( v ) ); + } + virtual void SetParent( const TVertex& v, const TVertex& p ) override + { + this->SetPixel( v, p - v ); + } protected: - MinimumSpanningTree( ); - virtual ~MinimumSpanningTree( ); + MinimumSpanningTree( ) + : Superclass( ) + { } + virtual ~MinimumSpanningTree( ) + { } private: - // Purposely not defined MinimumSpanningTree( const Self& other ); Self& operator=( const Self& other ); }; @@ -54,10 +66,6 @@ namespace fpa } // ecapseman -#ifndef ITK_MANUAL_INSTANTIATION -# include -#endif // ITK_MANUAL_INSTANTIATION - #endif // __fpa__Image__MinimumSpanningTree__h__ // eof - $RCSfile$