]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/MoriRegionGrow.h
50e8bb1e3cc1769b260bfbfa4fbe4a24c00ac5bc
[FrontAlgorithms.git] / lib / fpa / Image / MoriRegionGrow.h
1 #ifndef __fpa__Image__MoriRegionGrow__h__
2 #define __fpa__Image__MoriRegionGrow__h__
3
4 #include <fpa/Image/RegionGrow.h>
5 #include <fpa/Image/Functors/RegionGrow/BinaryThreshold.h>
6
7 namespace fpa
8 {
9   namespace Image
10   {
11     /**
12      */
13     template< class _TInputImage, class _TOutputImage >
14     class MoriRegionGrow
15       : public fpa::Image::RegionGrow< _TInputImage, _TOutputImage >
16     {
17     public:
18       typedef MoriRegionGrow                                        Self;
19       typedef fpa::Image::RegionGrow< _TInputImage, _TOutputImage > Superclass;
20       typedef itk::SmartPointer< Self >                             Pointer;
21       typedef itk::SmartPointer< const Self >                       ConstPointer;
22
23       typedef typename Superclass::TOutput       TOutput;
24       typedef typename Superclass::TVertex       TVertex;
25       typedef typename Superclass::TGrowFunction TGrowFunction;
26       typedef
27       fpa::Image::Functors::RegionGrow::BinaryThreshold< _TInputImage >
28       TBinThresholdFunction;
29       typedef typename _TInputImage::PixelType TPixel;
30
31     protected:
32       typedef typename Superclass::_TQueueNode _TQueueNode;
33       typedef typename Superclass::_TQueue     _TQueue;
34
35     public:
36       itkNewMacro( Self );
37       itkTypeMacro( fpa::Image::MoriRegionGrow, fpa::Image::RegionGrow );
38
39       itkGetConstMacro( Lower, TPixel );
40       itkGetConstMacro( Upper, TPixel );
41       itkGetConstMacro( Step, TPixel );
42
43       itkSetMacro( Lower, TPixel );
44       itkSetMacro( Upper, TPixel );
45       itkSetMacro( Step, TPixel );
46
47     protected:
48       MoriRegionGrow( );
49       virtual ~MoriRegionGrow( );
50
51       virtual bool _ContinueGenerateData( ) override;
52       virtual void _BeforeGenerateData( ) override;
53       virtual void _AfterGenerateData( ) override;
54       virtual void _BeforeLoop( ) override;
55       virtual void _AfterLoop( ) override;
56       virtual bool _UpdateValue( _TQueueNode& v, const _TQueueNode& p ) override;
57       virtual void _UpdateResult( const _TQueueNode& n ) override;
58
59     private:
60       // Purposely not defined
61       MoriRegionGrow( const Self& other );
62       Self& operator=( const Self& other );
63
64     protected:
65       TPixel m_Lower;
66       TPixel m_Upper;
67       TPixel m_Step;
68
69       _TQueue m_NextQueue;
70       unsigned long m_ActualCount;
71     };
72
73   } // ecapseman
74
75 } // ecapseman
76
77 #ifndef ITK_MANUAL_INSTANTIATION
78 #  include <fpa/Image/MoriRegionGrow.hxx>
79 #endif // ITK_MANUAL_INSTANTIATION
80
81 #endif // __fpa__Image__MoriRegionGrow__h__
82
83 // eof - $RCSfile$