X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FImage%2FRegionGrow.h;h=09631cc93becb731af623c166b7ca2a40fddc04d;hb=75a965968c4234c08e1ad1700ee5bc8da6362eba;hp=b12a869d87ccdca57610f351da531a9b71e30bc0;hpb=d3bb16bf060b7249a9ed1a49e6b118ca9394a22a;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/RegionGrow.h b/lib/fpa/Image/RegionGrow.h index b12a869..09631cc 100644 --- a/lib/fpa/Image/RegionGrow.h +++ b/lib/fpa/Image/RegionGrow.h @@ -1,85 +1,61 @@ -#ifndef __FPA__IMAGE__REGIONGROW__H__ -#define __FPA__IMAGE__REGIONGROW__H__ +// ========================================================================= +// @author Leonardo Florez Valencia +// @email florez-l@javeriana.edu.co +// ========================================================================= -#include -#include +#ifndef __fpa__Image__RegionGrow__h__ +#define __fpa__Image__RegionGrow__h__ + +#include #include +#include #include -#include +#include + namespace fpa { namespace Image { /** - * @param I Input image type */ - template< class I, class O = I, class CC = fpa::Image::Functors::CastVertexValueToCost< typename I::PixelType, typename O::PixelType > > + template< class _TInputImage, class _TOutputImage, class _TFrontId = unsigned char, class _TTraits = fpa::Image::DefaultTraits< _TInputImage, _TOutputImage, _TFrontId > > class RegionGrow - : public Algorithm< I, fpa::Base::RegionGrow< typename I::IndexType, typename O::PixelType, typename I::PixelType, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, itk::ImageToImageFilter< I, O > >, CC > + : public fpa::Base::RegionGrow< fpa::Image::Algorithm< _TTraits, fpa::Base::MarksInterfaceWithCollisions< _TTraits >, fpa::Base::SeedsInterface< _TTraits > > > { public: - // Standard class typdedefs - typedef typename I::IndexType TVertex; - typedef typename O::PixelType TResult; - typedef typename I::PixelType TVertexValue; - typedef itk::ImageToImageFilter< I, O > TBaseFilter; - typedef fpa::Base::RegionGrow< TVertex, TResult, TVertexValue, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, TBaseFilter > TBaseAlgorithm; + typedef _TInputImage TInputImage; + typedef _TOutputImage TOutputImage; + typedef _TTraits TTraits; + typedef fpa::Base::MarksInterfaceWithCollisions< TTraits > TMarksInterface; + typedef fpa::Base::SeedsInterface< TTraits > TSeedsInterface; - typedef RegionGrow Self; - typedef Algorithm< I, TBaseAlgorithm, CC > Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; + typedef fpa::Image::Algorithm< TTraits, TMarksInterface, TSeedsInterface > TAlgorithm; + typedef fpa::Base::RegionGrow< TAlgorithm > Superclass; + typedef RegionGrow Self; + typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer< const Self > ConstPointer; - typedef - fpa::Image::Functors::ImageFunction< I, bool > - TMembershipFunction; + fpa_Base_TraitTypes( typename TTraits ); 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; + // Purposely not implemented. + RegionGrow( const Self& other ); + Self& operator=( const Self& other ); }; } // ecapseman } // ecapseman -#endif // __FPA__IMAGE__REGIONGROW__H__ +#endif // __fpa__Image__RegionGrow__h__ // eof - $RCSfile$