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