1 #ifndef __fpa__Image__MoriFilter__h__
2 #define __fpa__Image__MoriFilter__h__
4 #include <itkImageToImageFilter.h>
5 #include <itkBinaryThresholdImageFilter.h>
6 #include <fpa/Image/MoriFilterHelper.h>
14 template< class _TInputImage, class _TOutputImage, class _TAuxPixel = unsigned short >
16 : public itk::ImageToImageFilter< _TInputImage, _TOutputImage >
19 typedef MoriFilter Self;
20 typedef itk::ImageToImageFilter< _TInputImage, _TOutputImage > Superclass;
21 typedef itk::SmartPointer< Self > Pointer;
22 typedef itk::SmartPointer< const Self > ConstPointer;
24 typedef itk::Image< _TAuxPixel, _TInputImage::ImageDimension > TAuxImage;
25 typedef fpa::Image::MoriFilterHelper< _TInputImage, TAuxImage > THelper;
26 typedef itk::BinaryThresholdImageFilter< TAuxImage, _TOutputImage > TThreshold;
28 typedef typename _TInputImage::IndexType TIndex;
29 typedef typename _TInputImage::PixelType TInputPixel;
30 typedef typename _TOutputImage::PixelType TOutputPixel;
31 typedef typename THelper::TCurve TCurve;
35 itkTypeMacro( fpa::Image::MoriFilter, itk::ImageToImageFilter );
37 itkGetConstMacro( Seed, TIndex );
38 itkSetMacro( Seed, TIndex );
41 TAuxImage* GetAuxiliaryImage( );
42 const TAuxImage* GetAuxiliaryImage( ) const;
44 TInputPixel GetLower( ) const;
45 TInputPixel GetUpper( ) const;
46 TInputPixel GetStep( ) const;
47 TOutputPixel GetInsideValue( ) const;
48 TOutputPixel GetOutsideValue( ) const;
49 TOutputPixel GetOptimumThreshold( ) const;
50 TCurve GetCurve( ) const;
52 void SetLower( const TInputPixel& v );
53 void SetUpper( const TInputPixel& v );
54 void SetStep( const TInputPixel& v );
55 void SetThresholdRange(
56 const TInputPixel& l, const TInputPixel& u,
57 const TInputPixel& s = TInputPixel( 1 )
59 void SetInsideValue( const TOutputPixel& v );
60 void SetOutsideValue( const TOutputPixel& v );
64 virtual ~MoriFilter( );
66 virtual void GenerateData( ) override;
69 // Purposely not defined
70 MoriFilter( const Self& other );
71 Self& operator=( const Self& other );
74 typename THelper::Pointer m_Helper;
75 typename TThreshold::Pointer m_Threshold;
83 #ifndef ITK_MANUAL_INSTANTIATION
84 # include <fpa/Image/MoriFilter.hxx>
85 #endif // ITK_MANUAL_INSTANTIATION
87 #endif // __fpa__Image__MoriFilter__h__