]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/MoriRegionGrow.h
41c122e32d9caf0c5d5cc89cdcb0e493ff23fb12
[FrontAlgorithms.git] / lib / fpa / Image / MoriRegionGrow.h
1 #ifndef __fpa__Image__MoriRegionGrow__h__
2 #define __fpa__Image__MoriRegionGrow__h__
3
4 #include <itkImageToImageFilter.h>
5 #include <itkBinaryThresholdImageFilter.h>
6 #include <fpa/Image/MoriRegionGrowHelper.h>
7
8 namespace fpa
9 {
10   namespace Image
11   {
12     /**
13      */
14     template< class _TInputImage, class _TOutputImage, class _TAuxPixel = unsigned short >
15     class MoriRegionGrow
16       : public itk::ImageToImageFilter< _TInputImage, _TOutputImage >
17     {
18     public:
19       typedef MoriRegionGrow                                         Self;
20       typedef itk::ImageToImageFilter< _TInputImage, _TOutputImage > Superclass;
21       typedef itk::SmartPointer< Self >                              Pointer;
22       typedef itk::SmartPointer< const Self >                        ConstPointer;
23
24       typedef itk::Image< _TAuxPixel, _TInputImage::ImageDimension >      TAuxImage;
25       typedef fpa::Image::MoriRegionGrowHelper< _TInputImage, TAuxImage > THelper;
26       typedef itk::BinaryThresholdImageFilter< TAuxImage, _TOutputImage > TThreshold;
27
28       typedef typename _TInputImage::IndexType  TIndex;
29       typedef typename _TInputImage::PixelType  TInputPixel;
30       typedef typename _TOutputImage::PixelType TOutputPixel;
31
32     public:
33       itkNewMacro( Self );
34       itkTypeMacro( fpa::Image::MoriRegionGrow, itk::ImageToImageFilter );
35
36       itkGetConstMacro( Seed, TIndex );
37       itkSetMacro( Seed, TIndex );
38
39     public:
40       TAuxImage* GetAuxiliaryImage( );
41       const TAuxImage* GetAuxiliaryImage( ) const;
42
43       TInputPixel GetLower( ) const;
44       TInputPixel GetUpper( ) const;
45       TInputPixel GetStep( ) const;
46       TOutputPixel GetInsideValue( ) const;
47       TOutputPixel GetOutsideValue( ) const;
48
49       void SetLower( const TInputPixel& v );
50       void SetUpper( const TInputPixel& v );
51       void SetStep( const TInputPixel& v );
52       void SetInsideValue( const TOutputPixel& v );
53       void SetOutsideValue( const TOutputPixel& v );
54
55
56       /* TODO
57          itkGetConstMacro( Lower, TPixel );
58          itkGetConstMacro( Upper, TPixel );
59          itkGetConstMacro( Step, TPixel );
60          itkGetConstMacro( Sensitivity, double );
61          itkSetMacro( Lower, TPixel );
62          itkSetMacro( Upper, TPixel );
63          itkSetMacro( Step, TPixel );
64          itkSetMacro( Sensitivity, double );
65       */
66
67     protected:
68       MoriRegionGrow( );
69       virtual ~MoriRegionGrow( );
70
71       virtual void GenerateData( ) override;
72
73     private:
74       // Purposely not defined
75       MoriRegionGrow( const Self& other );
76       Self& operator=( const Self& other );
77
78     protected:
79       typename THelper::Pointer m_Helper;
80       typename TThreshold::Pointer m_Threshold;
81       TIndex m_Seed;
82     };
83
84   } // ecapseman
85
86 } // ecapseman
87
88 #ifndef ITK_MANUAL_INSTANTIATION
89 #  include <fpa/Image/MoriRegionGrow.hxx>
90 #endif // ITK_MANUAL_INSTANTIATION
91
92 #endif // __fpa__Image__MoriRegionGrow__h__
93
94 // eof - $RCSfile$