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>
12 #include <fpa/Image/MarksInterface.h>
20 template< class _TInputImage, class _TOutputImage >
22 : public itk::ImageToImageFilter< _TInputImage, _TOutputImage >,
23 public fpa::Base::SeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::IndexType::LexicographicCompare >,
24 public fpa::Image::MarksInterface< _TInputImage::ImageDimension >
27 typedef _TInputImage TInputImage;
28 typedef _TOutputImage TOutputImage;
29 typedef typename TInputImage::IndexType TIndex;
30 typedef typename TInputImage::RegionType TRegion;
31 typedef typename TInputImage::PixelType TInputPixel;
32 typedef typename TOutputImage::PixelType TOutputPixel;
33 typedef typename TIndex::LexicographicCompare TIndexCompare;
35 typedef RegionGrow Self;
36 typedef itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass;
37 typedef itk::SmartPointer< Self > Pointer;
38 typedef itk::SmartPointer< const Self > ConstPointer;
40 typedef fpa::Base::SeedsInterface< TIndex, TIndexCompare > TSeedsInterface;
41 typedef fpa::Image::MarksInterface< _TInputImage::ImageDimension > TMarksInterface;
42 typedef itk::FunctionBase< TInputPixel, bool > TIntensityFunctor;
46 itkTypeMacro( fpa::Image::RegionGrow, itk::ImageToImageFilter );
48 itkGetConstMacro( InsideValue, TOutputPixel );
49 itkGetConstMacro( OutsideValue, TOutputPixel );
51 itkSetMacro( InsideValue, TOutputPixel );
52 itkSetMacro( OutsideValue, TOutputPixel );
55 void SetPredicate( TIntensityFunctor* functor );
59 virtual ~RegionGrow( );
61 virtual void GenerateInputRequestedRegion( ) override;
62 virtual void EnlargeOutputRequestedRegion(
63 itk::DataObject* output
65 virtual void GenerateData( ) override;
68 // Purposely not implemented
69 RegionGrow( const Self& other );
70 Self& operator=( const Self& other );
73 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__