X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2Ffpa%2FImage%2FRegionGrow.h;h=2deff2f637de9001588b0ddbd8bdf1e261188ee1;hb=fe01e92d9bce3519fa2a0936b6180ca7b057a87a;hp=e20f062e07cf6c2563da1533437ed969bb2f4207;hpb=b70a564ee2d7bc180b77a05c37ab431ab9c393e7;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/RegionGrow.h b/lib/fpa/Image/RegionGrow.h index e20f062..2deff2f 100644 --- a/lib/fpa/Image/RegionGrow.h +++ b/lib/fpa/Image/RegionGrow.h @@ -1,9 +1,14 @@ -#ifndef __FPA__IMAGE__REGIONGROW__H__ -#define __FPA__IMAGE__REGIONGROW__H__ +// ========================================================================= +// @author Leonardo Florez Valencia +// @email florez-l@javeriana.edu.co +// ========================================================================= + +#ifndef __fpa__Image__RegionGrow__h__ +#define __fpa__Image__RegionGrow__h__ -#include -#include #include +#include +#include #include namespace fpa @@ -11,67 +16,57 @@ namespace fpa namespace Image { /** - * @param I Input image type - * @param O Output image type */ - template< class I, class O > + template< class _TInputImage, class _TOutputImage, class _TFrontId = unsigned char > class RegionGrow - : public Algorithm< I, O, fpa::Base::RegionGrow< typename I::IndexType, typename I::PixelType, typename O::PixelType, itk::ImageToImageFilter< I, O > > > + : public fpa::Base::RegionGrow< fpa::Image::Algorithm< _TInputImage, _TOutputImage, fpa::Base::MarksInterfaceWithCollisions< typename _TInputImage::IndexType >, fpa::Base::SeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::PointType, typename _TInputImage::PixelType, typename _TOutputImage::PixelType, _TFrontId, typename _TInputImage::IndexType::LexicographicCompare > > > { public: - typedef fpa::Base::RegionGrow< typename I::IndexType, typename I::PixelType, typename O::PixelType, itk::ImageToImageFilter< I, O > > TBaseAlgorithm; + typedef _TInputImage TInputImage; + typedef _TOutputImage TOutputImage; + typedef _TFrontId TFrontId; - typedef RegionGrow Self; - typedef Algorithm< I, O, TBaseAlgorithm > Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; + typedef typename TInputImage::IndexType TVertex; + typedef typename TInputImage::PointType TPoint; + typedef typename TVertex::LexicographicCompare TVertexCompare; + typedef typename TInputImage::PixelType TInputValue; + typedef typename TOutputImage::PixelType TOutputValue; - typedef typename Superclass::TInputImage TInputImage; - typedef typename Superclass::TOutputImage TOutputImage; - typedef typename Superclass::TVertex TVertex; - typedef typename Superclass::TValue TValue; - typedef typename Superclass::TResult TResult; + typedef fpa::Base::MarksInterfaceWithCollisions< TVertex > TMarksInterface; + typedef fpa::Base::SeedsInterface< TVertex, TPoint, TInputValue, TOutputValue, TFrontId, TVertexCompare > TSeedsInterface; + typedef fpa::Image::Algorithm< TInputImage, TOutputImage, TMarksInterface, TSeedsInterface > TAlgorithm; - typedef itk::FunctionBase< TValue, bool > TMembershipFunction; + typedef RegionGrow Self; + typedef fpa::Base::RegionGrow< TAlgorithm > Superclass; + typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer< const Self > ConstPointer; - protected: - typedef typename Superclass::_TVertices _TVertices; - typedef typename Superclass::_TCollision _TCollision; - typedef typename Superclass::_TCollisionsRow _TCollisionsRow; - typedef typename Superclass::_TCollisions _TCollisions; - typedef typename Superclass::_TNode _TNode; - typedef typename Superclass::_TNodes _TNodes; + typedef typename TSeedsInterface::TNode TNode; + typedef typename TSeedsInterface::TNodes TNodes; public: itkNewMacro( Self ); - itkTypeMacro( RegionGrow, Algorithm ); - - itkGetObjectMacro( MembershipFunction, TMembershipFunction ); - itkGetConstObjectMacro( MembershipFunction, TMembershipFunction ); - itkSetObjectMacro( MembershipFunction, TMembershipFunction ); + itkTypeMacro( fpa::Image::RegionGrow, fpa::Base::RegionGrow ); protected: - RegionGrow( ); - virtual ~RegionGrow( ); - - virtual bool _CheckMembership( const TVertex& v ) const; - virtual void _InitResults( ); + RegionGrow( ) + : Superclass( ) + { + } + virtual ~RegionGrow( ) + { + } private: - // Purposely not implemented + // Purposely not implemented. RegionGrow( const Self& other ); Self& operator=( const Self& other ); - - protected: - typename TMembershipFunction::Pointer m_MembershipFunction; }; } // ecapseman } // ecapseman -#include - -#endif // __FPA__IMAGE__REGIONGROW__H__ +#endif // __fpa__Image__RegionGrow__h__ // eof - $RCSfile$