1 #ifndef __fpa__Image__MoriFilterHelper__h__
2 #define __fpa__Image__MoriFilterHelper__h__
5 #include <fpa/Image/RegionGrow.h>
6 #include <fpa/Image/Functors/RegionGrow/BinaryThreshold.h>
10 #include <itkImageToImageFilter.h>
18 template< class _TInputImage, class _TOutputImage >
19 class MoriFilterHelper
20 : public itk::ImageToImageFilter< _TInputImage, _TOutputImage >
23 typedef MoriFilterHelper Self;
24 typedef itk::ImageToImageFilter< _TInputImage, _TOutputImage > Superclass;
25 typedef itk::SmartPointer< Self > Pointer;
26 typedef itk::SmartPointer< const Self > ConstPointer;
28 typedef _TInputImage TInputImage;
29 typedef _TOutputImage TOutputImage;
30 typedef typename TInputImage::IndexType TIndex;
31 typedef typename TInputImage::PixelType TInputPixel;
32 typedef typename TOutputImage::PixelType TOutputPixel;
34 typedef std::pair< TInputPixel, unsigned long > TCurveData;
35 typedef std::vector< TCurveData > TCurve;
38 typedef typename Superclass::TOutput TOutput;
39 typedef typename Superclass::TVertex TVertex;
40 typedef typename Superclass::TGrowFunction TGrowFunction;
41 typedef typename _TInputImage::PixelType TPixel;
42 typedef fpa::Image::Functors::RegionGrow::BinaryThreshold< _TInputImage, TOutput > TBinThresholdFunction;
44 typedef typename Superclass::_TQueueNode _TQueueNode;
45 typedef typename Superclass::_TQueue _TQueue;
50 itkTypeMacro( fpa::Image::MoriFilterHelper, itk::ImageToImageFilter );
52 itkGetConstMacro( Seed, TIndex );
53 itkGetConstMacro( Lower, TInputPixel );
54 itkGetConstMacro( Upper, TInputPixel );
55 itkGetConstMacro( Step, TInputPixel );
56 itkGetConstMacro( OptimumThreshold, typename _TOutputImage::PixelType );
57 itkGetConstMacro( Curve, TCurve );
59 itkSetMacro( Seed, TIndex );
60 itkSetMacro( Lower, TInputPixel );
61 itkSetMacro( Upper, TInputPixel );
62 itkSetMacro( Step, TInputPixel );
69 virtual ~MoriFilterHelper( )
74 virtual bool _ContinueGenerateData( ) override;
75 virtual void _BeforeGenerateData( ) override;
76 virtual void _AfterGenerateData( ) override;
77 virtual void _BeforeLoop( ) override;
78 virtual void _AfterLoop( ) override;
79 virtual bool _UpdateValue( _TQueueNode& v, const _TQueueNode& p ) override;
80 virtual bool _UpdateResult( _TQueueNode& n ) override;
84 // Purposely not defined
85 MoriFilterHelper( const Self& other );
86 Self& operator=( const Self& other );
93 typename _TOutputImage::PixelType m_OptimumThreshold;
95 unsigned long m_ActualCount;
104 #ifndef ITK_MANUAL_INSTANTIATION
105 # include <fpa/Image/MoriFilterHelper.hxx>
106 #endif // ITK_MANUAL_INSTANTIATION
109 #endif // __fpa__Image__MoriFilterHelper__h__