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>
19 template< class _TInputImage, class _TOutputImage >
21 : public itk::ImageToImageFilter< _TInputImage, _TOutputImage >
24 typedef _TInputImage TInputImage;
25 typedef _TOutputImage TOutputImage;
27 typedef RegionGrow Self;
28 typedef itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass;
29 typedef itk::SmartPointer< Self > Pointer;
30 typedef itk::SmartPointer< const Self > ConstPointer;
32 typedef typename TInputImage::IndexType TIndex;
33 typedef typename TInputImage::RegionType TRegion;
34 typedef typename TInputImage::PixelType TInputPixel;
35 typedef typename TOutputImage::PixelType TOutputPixel;
37 typedef itk::FunctionBase< TInputPixel, bool > TIntensityFunctor;
39 typedef std::set< TIndex, typename TIndex::LexicographicCompare > TSeeds;
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 );
54 void AddSeed( const TIndex& seed );
58 virtual ~RegionGrow( );
60 virtual void GenerateInputRequestedRegion( ) override;
61 virtual void EnlargeOutputRequestedRegion(
62 itk::DataObject* output
64 virtual void GenerateData( ) override;
67 // Purposely not implemented
68 RegionGrow( const Self& other );
69 Self& operator=( const Self& other );
72 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__