]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/RegionGrow.h
...
[FrontAlgorithms.git] / lib / fpa / Base / RegionGrow.h
1 #ifndef __fpa__Base__RegionGrow__h__
2 #define __fpa__Base__RegionGrow__h__
3
4 #include <queue>
5 #include <fpa/Config.h>
6 #include <fpa/Base/Functors/RegionGrow/Base.h>
7
8 namespace fpa
9 {
10   namespace Base
11   {
12     /**
13      */
14     template< class _TSuperclass >
15     class RegionGrow
16       : public _TSuperclass
17     {
18     public:
19       typedef RegionGrow                      Self;
20       typedef _TSuperclass                    Superclass;
21       typedef itk::SmartPointer< Self >       Pointer;
22       typedef itk::SmartPointer< const Self > ConstPointer;
23
24       typedef typename Superclass::TOutput TOutput;
25       typedef typename Superclass::TVertex TVertex;
26
27       typedef fpa::Base::Functors::RegionGrow::Base< TVertex > TGrowFunction;
28
29     protected:
30       typedef typename Superclass::_TQueueNode _TQueueNode;
31       typedef std::queue< _TQueueNode > _TQueue;
32
33     public:
34       itkTypeMacro( RegionGrow, Algorithm );
35
36       itkGetObjectMacro( GrowFunction, TGrowFunction );
37       itkGetConstMacro( InsideValue, TOutput );
38       itkGetConstMacro( OutsideValue, TOutput );
39
40       itkSetObjectMacro( GrowFunction, TGrowFunction );
41       itkSetMacro( InsideValue, TOutput );
42       itkSetMacro( OutsideValue, TOutput );
43
44     protected:
45       RegionGrow( );
46       virtual ~RegionGrow( );
47
48       virtual bool _UpdateValue(
49         _TQueueNode& v, const _TQueueNode& p
50         ) override;
51       virtual unsigned long _QueueSize( ) const override;
52       virtual void _QueueClear( ) override;
53       virtual void _QueuePush( const _TQueueNode& node ) override;
54       virtual _TQueueNode _QueuePop( ) override;
55
56     private:
57       // Purposely not defined
58       RegionGrow( const Self& other );
59       Self& operator=( const Self& other );
60
61     protected:
62       TOutput m_InsideValue;
63       TOutput m_OutsideValue;
64       _TQueue m_Queue;
65       typename TGrowFunction::Pointer m_GrowFunction;
66     };
67
68   } // ecapseman
69
70 } // ecapseman
71
72 #ifndef ITK_MANUAL_INSTANTIATION
73 #  include <fpa/Base/RegionGrow.hxx>
74 #endif // ITK_MANUAL_INSTANTIATION
75
76 #endif // __fpa__Base__RegionGrow__h__
77
78 // eof - $RCSfile$