X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FImage%2FRegionGrow.h;h=ad41e80a2dbea689573b407e36c3ea2c23b03b22;hb=86a6d5df2aa1aa5292a5fa851d98bfc13939bdf3;hp=d65fa6cbbe815e9a3b3c21a290cc18357cec4421;hpb=9622bd5b833a8845881003228207e0caca59b081;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/RegionGrow.h b/lib/fpa/Image/RegionGrow.h index d65fa6c..ad41e80 100644 --- a/lib/fpa/Image/RegionGrow.h +++ b/lib/fpa/Image/RegionGrow.h @@ -1,9 +1,6 @@ -#ifndef __FPA__IMAGE__REGIONGROW__H__ -#define __FPA__IMAGE__REGIONGROW__H__ +#ifndef __fpa__Image__RegionGrow__h__ +#define __fpa__Image__RegionGrow__h__ -#include -#include -#include #include #include @@ -12,72 +9,47 @@ 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::Algorithm< _TInputImage, _TOutputImage > > { 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 fpa::Image::Algorithm< _TInputImage, _TOutputImage > TAlgorithm; + typedef RegionGrow Self; + typedef fpa::Base::RegionGrow< TAlgorithm > Superclass; + typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer< const Self > ConstPointer; - typedef RegionGrow Self; - typedef Algorithm< I, TBaseAlgorithm > Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; + typedef typename Superclass::TOutput TOutput; + typedef typename Superclass::TVertex TVertex; - typedef itk::ImageFunction< I, bool > TMembershipFunction; + typedef fpa::Image::Functors::Base< _TInputImage, typename Superclass::TGrowFunction > TGrowFunction; 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( ) - { } + RegionGrow( ); + 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->EvaluateAtIndex( n.Vertex ) ); - } - else - return( false ); - } + virtual void _BeforeGenerateData( ) fpa_OVERRIDE; private: - // Purposely not implemented - RegionGrow( const Self& ); - void operator=( const Self& ); - - protected: - typename TMembershipFunction::Pointer m_MembershipFunction; + // Purposely not defined + RegionGrow( const Self& other ); + Self& operator=( const Self& other ); }; } // ecapseman } // ecapseman -#endif // __FPA__IMAGE__REGIONGROW__H__ +#ifndef ITK_MANUAL_INSTANTIATION +# include +#endif // ITK_MANUAL_INSTANTIATION + +#endif // __fpa__Image__RegionGrow__h__ // eof - $RCSfile$