]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/MoriRegionGrow.h
...
[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       itkGetConstMacro( Sensitivity, double );
43
44       itkSetMacro( Lower, TPixel );
45       itkSetMacro( Upper, TPixel );
46       itkSetMacro( Step, TPixel );
47       itkSetMacro( Sensitivity, double );
48
49     protected:
50       MoriRegionGrow( );
51       virtual ~MoriRegionGrow( );
52
53       virtual bool _ContinueGenerateData( ) override;
54       virtual void _BeforeGenerateData( ) override;
55       virtual void _AfterGenerateData( ) override;
56       virtual void _BeforeLoop( ) override;
57       virtual void _AfterLoop( ) override;
58       virtual bool _UpdateValue( _TQueueNode& v, const _TQueueNode& p ) override;
59       virtual void _UpdateResult( const _TQueueNode& n ) override;
60
61     private:
62       // Purposely not defined
63       MoriRegionGrow( const Self& other );
64       Self& operator=( const Self& other );
65
66     protected:
67       TPixel m_Lower;
68       TPixel m_Upper;
69       TPixel m_Step;
70       double m_Sensitivity;
71
72       _TQueue m_NextQueue;
73       unsigned long m_ActualCount;
74       unsigned long m_PrevCount;
75
76       // Standard deviation
77       double m_N;
78       double m_S1;
79       double m_S2;
80       double m_STD;
81     };
82
83   } // ecapseman
84
85 } // ecapseman
86
87 #ifndef ITK_MANUAL_INSTANTIATION
88 #  include <fpa/Image/MoriRegionGrow.hxx>
89 #endif // ITK_MANUAL_INSTANTIATION
90
91 #endif // __fpa__Image__MoriRegionGrow__h__
92
93 // eof - $RCSfile$