]> Creatis software - FrontAlgorithms.git/blob - libs/fpa/Base/MoriRegionGrow.h
...
[FrontAlgorithms.git] / libs / fpa / Base / MoriRegionGrow.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5
6 #ifndef __fpa__Base__MoriRegionGrow__h__
7 #define __fpa__Base__MoriRegionGrow__h__
8
9 namespace fpa
10 {
11   namespace Base
12   {
13     /**
14      */
15     template< class _TFilter, class _TMarksInterface, class _TSeedsInterface >
16     class MoriRegionGrow
17       : public _TFilter,
18         public _TMarksInterface,
19         public _TSeedsInterface
20     {
21     public:
22       typedef MoriRegionGrow                  Self;
23       typedef _TFilter                        Superclass;
24       typedef _TMarksInterface                TMarksInterface;
25       typedef _TSeedsInterface                TSeedsInterface;
26       typedef itk::SmartPointer< Self >       Pointer;
27       typedef itk::SmartPointer< const Self > ConstPointer;
28
29       typedef typename Superclass::TInputValue  TInputValue;
30       typedef typename Superclass::TOutputValue TOutputValue;
31       typedef typename Superclass::TVertex      TVertex;
32       typedef typename Superclass::TVertices    TVertices;
33
34       struct TCurveData
35       {
36         TInputValue XValue;
37         unsigned long YValue;
38         double Diff1;
39         TCurveData( TInputValue v, unsigned long c )
40           {
41             this->XValue = v;
42             this->YValue = c;
43             this->Diff1 = double( 0 );
44           }
45       };
46       typedef std::vector< TCurveData > TCurve;
47
48     public:
49       itkTypeMacro( MoriRegionGrow, TFilter );
50
51       itkGetConstMacro( LowerThreshold, TInputValue );
52       itkGetConstMacro( UpperThreshold, TInputValue );
53       itkGetConstMacro( DeltaThreshold, TInputValue );
54       itkGetConstMacro( Curve, TCurve );
55       itkGetConstMacro( OptimumThreshold, TInputValue );
56
57       itkSetMacro( LowerThreshold, TInputValue );
58       itkSetMacro( UpperThreshold, TInputValue );
59       itkSetMacro( DeltaThreshold, TInputValue );
60
61     public:
62       void SetThresholdRange(
63         const TInputValue& lower, const TInputValue& upper,
64         const TInputValue& delta = TInputValue( 1 )
65         );
66
67     protected:
68       MoriRegionGrow( );
69       virtual ~MoriRegionGrow( );
70
71       virtual void GenerateData( ) override;
72
73     private:
74       MoriRegionGrow( const Self& other );
75       Self& operator=( const Self& other );
76
77     protected:
78       TInputValue  m_LowerThreshold;
79       TInputValue  m_UpperThreshold;
80       TInputValue  m_DeltaThreshold;
81
82       TCurve m_Curve;
83       TInputValue  m_OptimumThreshold;
84     };
85
86   } // ecapseman
87
88 } // ecapseman
89
90 #ifndef ITK_MANUAL_INSTANTIATION
91 #  include <fpa/Base/MoriRegionGrow.hxx>
92 #endif // ITK_MANUAL_INSTANTIATION
93
94 #endif // __fpa__Base__MoriRegionGrow__h__
95
96 // eof - $RCSfile$