X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=inline;f=libs%2Ffpa%2FImage%2FRegionGrow.h;h=5d7b4db227fabcbf2aeda4fd19f4b09a3041400b;hb=5e0c313e26ec0a292b5ee965b5a22a2ed60c1021;hp=f60847982cff93c6225b3138634e3b22999d6d7c;hpb=1bde955a3f32330dcbbd2c190de75a8f77865de9;p=FrontAlgorithms.git diff --git a/libs/fpa/Image/RegionGrow.h b/libs/fpa/Image/RegionGrow.h index f608479..5d7b4db 100644 --- a/libs/fpa/Image/RegionGrow.h +++ b/libs/fpa/Image/RegionGrow.h @@ -6,10 +6,10 @@ #ifndef __fpa__Image__RegionGrow__h__ #define __fpa__Image__RegionGrow__h__ -#include -#include +#include #include #include +#include namespace fpa { @@ -19,70 +19,37 @@ namespace fpa */ template< class _TInputImage, class _TOutputImage > class RegionGrow - : public itk::ImageToImageFilter< _TInputImage, _TOutputImage >, - public fpa::Base::SeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::IndexType::LexicographicCompare >, - public fpa::Image::MarksInterface< _TInputImage::ImageDimension > + : 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: - typedef _TInputImage TInputImage; - typedef _TOutputImage TOutputImage; - typedef typename TInputImage::IndexType TIndex; - typedef typename TInputImage::RegionType TRegion; - typedef typename TInputImage::PixelType TInputPixel; - typedef typename TOutputImage::PixelType TOutputPixel; - typedef typename TIndex::LexicographicCompare TIndexCompare; - - typedef RegionGrow Self; - typedef itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - typedef fpa::Base::SeedsInterface< TIndex, TIndexCompare > TSeedsInterface; + // Interfaces + typedef fpa::Image::Filter< _TInputImage, _TOutputImage > TFilter; typedef fpa::Image::MarksInterface< _TInputImage::ImageDimension > TMarksInterface; - typedef itk::FunctionBase< TInputPixel, bool > TIntensityFunctor; - - public: - itkNewMacro( Self ); - itkTypeMacro( fpa::Image::RegionGrow, itk::ImageToImageFilter ); - - itkGetConstMacro( InsideValue, TOutputPixel ); - itkGetConstMacro( OutsideValue, TOutputPixel ); + typedef fpa::Base::SeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::IndexType::LexicographicCompare > TSeedsInterface; - itkSetMacro( InsideValue, TOutputPixel ); - itkSetMacro( OutsideValue, TOutputPixel ); + // Smart pointers + typedef RegionGrow Self; + typedef fpa::Base::RegionGrow< TFilter, TMarksInterface, TSeedsInterface > Superclass; + typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer< const Self > ConstPointer; public: - void SetPredicate( TIntensityFunctor* functor ); + itkNewMacro( Self ); + itkTypeMacro( fpa::Image::RegionGrow, fpa::Base::RegionGrow ); protected: - RegionGrow( ); - virtual ~RegionGrow( ); - - virtual void GenerateInputRequestedRegion( ) override; - virtual void EnlargeOutputRequestedRegion( - itk::DataObject* output - ) override; - virtual void GenerateData( ) override; + RegionGrow( ) : Superclass( ) { } + virtual ~RegionGrow( ) { } private: - // Purposely not implemented RegionGrow( const Self& other ); Self& operator=( const Self& other ); - - protected: - typename TIntensityFunctor::Pointer m_IntensityFunctor; - TOutputPixel m_InsideValue; - TOutputPixel m_OutsideValue; }; } // ecapseman } // ecapseman -#ifndef ITK_MANUAL_INSTANTIATION -# include -#endif // ITK_MANUAL_INSTANTIATION - #endif // __fpa__Image__RegionGrow__h__ // eof - $RCSfile$