1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Image__RegionGrow__h__
7 #define __fpa__Image__RegionGrow__h__
9 #include <itkImageToImageFilter.h>
10 #include <itkFunctionBase.h>
11 #include <fpa/Base/SeedsInterface.h>
19 template< class _TInputImage, class _TOutputImage >
21 : public itk::ImageToImageFilter< _TInputImage, _TOutputImage >,
22 public fpa::Base::SeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::IndexType::LexicographicCompare >
25 typedef _TInputImage TInputImage;
26 typedef _TOutputImage TOutputImage;
27 typedef typename TInputImage::IndexType TIndex;
28 typedef typename TInputImage::RegionType TRegion;
29 typedef typename TInputImage::PixelType TInputPixel;
30 typedef typename TOutputImage::PixelType TOutputPixel;
31 typedef typename TIndex::LexicographicCompare TIndexCompare;
33 typedef RegionGrow Self;
34 typedef itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass;
35 typedef itk::SmartPointer< Self > Pointer;
36 typedef itk::SmartPointer< const Self > ConstPointer;
38 typedef fpa::Base::SeedsInterface< TIndex, TIndexCompare > TSeedsInterface;
39 typedef itk::FunctionBase< TInputPixel, bool > TIntensityFunctor;
43 itkTypeMacro( fpa::Image::RegionGrow, itk::ImageToImageFilter );
45 itkGetConstMacro( InsideValue, TOutputPixel );
46 itkGetConstMacro( OutsideValue, TOutputPixel );
48 itkSetMacro( InsideValue, TOutputPixel );
49 itkSetMacro( OutsideValue, TOutputPixel );
52 void SetPredicate( TIntensityFunctor* functor );
56 virtual ~RegionGrow( );
58 virtual void GenerateInputRequestedRegion( ) override;
59 virtual void EnlargeOutputRequestedRegion(
60 itk::DataObject* output
62 virtual void GenerateData( ) override;
65 // Purposely not implemented
66 RegionGrow( const Self& other );
67 Self& operator=( const Self& other );
70 typename TIntensityFunctor::Pointer m_IntensityFunctor;
74 TOutputPixel m_InsideValue;
75 TOutputPixel m_OutsideValue;
82 #ifndef ITK_MANUAL_INSTANTIATION
83 # include <fpa/Image/RegionGrow.hxx>
84 #endif // ITK_MANUAL_INSTANTIATION
86 #endif // __fpa__Image__RegionGrow__h__