// ========================================================================= // @author Leonardo Florez Valencia // @email florez-l@javeriana.edu.co // ========================================================================= #ifndef __fpa__Image__RegionGrow__h__ #define __fpa__Image__RegionGrow__h__ #include #include #include #include namespace fpa { namespace Image { /** */ 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: 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; 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 ); itkSetMacro( InsideValue, TOutputPixel ); itkSetMacro( OutsideValue, TOutputPixel ); public: void SetPredicate( TIntensityFunctor* functor ); protected: RegionGrow( ); virtual ~RegionGrow( ); virtual void GenerateInputRequestedRegion( ) override; virtual void EnlargeOutputRequestedRegion( itk::DataObject* output ) override; virtual void GenerateData( ) override; 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$