X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FImage%2FRegionGrow.h;h=5d7b4db227fabcbf2aeda4fd19f4b09a3041400b;hb=60785c9e18cab1a338f1ce54551e97a5ddfabac1;hp=dd7c851a5bf5324ad12b72d101a9f59910e57232;hpb=79df4abfecefc36c0dfca7d9f6f2978882de95dc;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/RegionGrow.h b/lib/fpa/Image/RegionGrow.h index dd7c851..5d7b4db 100644 --- a/lib/fpa/Image/RegionGrow.h +++ b/lib/fpa/Image/RegionGrow.h @@ -1,85 +1,55 @@ -#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 +#include +#include namespace fpa { namespace Image { /** - * @param I Input image type */ - template< class I > + template< class _TInputImage, class _TOutputImage > class RegionGrow - : public Algorithm< I, fpa::Base::RegionGrow< typename I::IndexType, typename I::PixelType, typename I::PixelType, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, itk::ImageToImageFilter< I, I > > > + : public fpa::Base::RegionGrow< fpa::Image::Filter< _TInputImage, _TOutputImage >, fpa::Image::MarksInterface< _TInputImage::ImageDimension >, fpa::Base::SeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::IndexType::LexicographicCompare > > { public: - // Standard class typdedefs - typedef typename I::IndexType TVertex; - typedef typename I::PixelType TResult; - typedef typename I::PixelType TVertexValue; - typedef itk::ImageToImageFilter< I, I > TBaseFilter; - typedef fpa::Base::RegionGrow< TVertex, TResult, TVertexValue, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, TBaseFilter > TBaseAlgorithm; - - typedef RegionGrow Self; - typedef Algorithm< I, TBaseAlgorithm > Superclass; - typedef itk::SmartPointer< Self > Pointer; + // Interfaces + typedef fpa::Image::Filter< _TInputImage, _TOutputImage > TFilter; + typedef fpa::Image::MarksInterface< _TInputImage::ImageDimension > TMarksInterface; + typedef fpa::Base::SeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::IndexType::LexicographicCompare > TSeedsInterface; + + // Smart pointers + typedef RegionGrow Self; + typedef fpa::Base::RegionGrow< TFilter, TMarksInterface, TSeedsInterface > Superclass; + typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; - typedef - fpa::Image::Functors::ImageFunction< I, bool > - TMembershipFunction; - public: itkNewMacro( Self ); - itkTypeMacro( RegionGrow, fpaBaseRegionGrow ); - - itkGetObjectMacro( MembershipFunction, TMembershipFunction ); - itkSetObjectMacro( MembershipFunction, TMembershipFunction ); + itkTypeMacro( fpa::Image::RegionGrow, fpa::Base::RegionGrow ); protected: - RegionGrow( ) - : Superclass( ), - m_MembershipFunction( NULL ) - { } - virtual ~RegionGrow( ) - { } - - virtual bool _CheckMembership( - const typename Superclass::_TNode& n - ) const - { - if( this->m_MembershipFunction.IsNotNull( ) ) - { - if( - this->m_MembershipFunction->GetInputImage( ) != - this->GetInput( ) - ) - this->m_MembershipFunction->SetInputImage( this->GetInput( ) ); - return( this->m_MembershipFunction->Evaluate( n.Vertex ) ); - } - else - return( false ); - } + RegionGrow( ) : Superclass( ) { } + virtual ~RegionGrow( ) { } private: - // Purposely not implemented - RegionGrow( const Self& ); - void operator=( const Self& ); - - protected: - typename TMembershipFunction::Pointer m_MembershipFunction; + RegionGrow( const Self& other ); + Self& operator=( const Self& other ); }; } // ecapseman } // ecapseman -#endif // __FPA__IMAGE__REGIONGROW__H__ +#endif // __fpa__Image__RegionGrow__h__ // eof - $RCSfile$