X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=libs%2Ffpa%2FImage%2FRegionGrow.h;h=6981f756f124dcc1d997bc423cbbbee1e1664fca;hb=3636868ab0f433aa5e8e839556b76febe0db3494;hp=dbc57f00759be5d017c1c49bb0c42f0eba583c71;hpb=20916948d3878c722b73e7ee86df87ff2df9d0fe;p=FrontAlgorithms.git diff --git a/libs/fpa/Image/RegionGrow.h b/libs/fpa/Image/RegionGrow.h index dbc57f0..6981f75 100644 --- a/libs/fpa/Image/RegionGrow.h +++ b/libs/fpa/Image/RegionGrow.h @@ -1,8 +1,14 @@ +// ========================================================================= +// @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 namespace fpa { @@ -12,34 +18,61 @@ namespace fpa */ template< class _TInputImage, class _TOutputImage > class RegionGrow - : public fpa::Base::RegionGrow< fpa::Image::Algorithm< _TInputImage, _TOutputImage > > + : public itk::ImageToImageFilter< _TInputImage, _TOutputImage > { public: - 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 _TInputImage TInputImage; + typedef _TOutputImage TOutputImage; + + typedef RegionGrow Self; + typedef itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass; + typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer< const Self > ConstPointer; + + typedef typename TInputImage::IndexType TIndex; + typedef typename TInputImage::RegionType TRegion; + typedef typename TInputImage::PixelType TInputPixel; + typedef typename TOutputImage::PixelType TOutputPixel; - typedef typename Superclass::TOutput TOutput; - typedef typename Superclass::TVertex TVertex; + typedef itk::FunctionBase< TInputPixel, bool > TIntensityFunctor; - typedef fpa::Image::Functors::Base< _TInputImage, typename Superclass::TGrowFunction > TGrowFunction; + typedef std::set< TIndex, typename TIndex::LexicographicCompare > TSeeds; public: itkNewMacro( Self ); - itkTypeMacro( fpa::Image::RegionGrow, fpa::Base::RegionGrow ); + itkTypeMacro( fpa::Image::RegionGrow, itk::ImageToImageFilter ); + + itkGetConstMacro( InsideValue, TOutputPixel ); + itkGetConstMacro( OutsideValue, TOutputPixel ); + + itkSetMacro( InsideValue, TOutputPixel ); + itkSetMacro( OutsideValue, TOutputPixel ); + + public: + void SetPredicate( TIntensityFunctor* functor ); + + void AddSeed( const TIndex& seed ); protected: RegionGrow( ); virtual ~RegionGrow( ); - virtual void _BeforeGenerateData( ) override; + virtual void GenerateInputRequestedRegion( ) override; + virtual void EnlargeOutputRequestedRegion( + itk::DataObject* output + ) override; + virtual void GenerateData( ) override; private: - // Purposely not defined + // Purposely not implemented RegionGrow( const Self& other ); Self& operator=( const Self& other ); + + protected: + typename TIntensityFunctor::Pointer m_IntensityFunctor; + TSeeds m_Seeds; + TOutputPixel m_InsideValue; + TOutputPixel m_OutsideValue; }; } // ecapseman