]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/IncrementalRegionGrow.h
CMake updated. Some other filters added.
[FrontAlgorithms.git] / lib / fpa / Base / IncrementalRegionGrow.h
1 #ifndef __FPA__BASE__INCREMENTALREGIONGROW__H__
2 #define __FPA__BASE__INCREMENTALREGIONGROW__H__
3
4 #include <vector>
5 #include <itkFunctionBase.h>
6 #include <fpa/Base/RegionGrow.h>
7
8 namespace fpa
9 {
10   namespace Base
11   {
12     /**
13      * Region grow is a front propagation with no costs.
14      */
15     template< class V, class R, class VV, class VC, class B >
16     class IncrementalRegionGrow
17       : public RegionGrow< V, R, VV, VC, B >
18     {
19     public:
20       /// Standard class typdedefs
21       typedef IncrementalRegionGrow  Self;
22       typedef RegionGrow< V, R, VV, VC, B >   Superclass;
23       typedef itk::SmartPointer< Self >       Pointer;
24       typedef itk::SmartPointer< const Self > ConstPointer;
25
26       typedef typename Superclass::TVertex          TVertex;
27       typedef typename Superclass::TValue           TValue;
28       typedef typename Superclass::TResult          TResult;
29       typedef typename Superclass::TVertexCompare   TVertexCompare;
30       typedef typename Superclass::TGrowingFunction TGrowingFunction;
31
32       typedef std::vector< typename TGrowingFunction::Pointer > TFunctions;
33       typedef std::vector< unsigned long >                      TVolumes;
34
35     protected:
36       typedef typename Superclass::_TVertices      _TVertices;
37       typedef typename Superclass::_TCollision     _TCollision;
38       typedef typename Superclass::_TCollisionsRow _TCollisionsRow;
39       typedef typename Superclass::_TCollisions    _TCollisions;
40       typedef typename Superclass::_TNode          _TNode;
41       typedef typename Superclass::_TNodes         _TNodes;
42       typedef typename Superclass::_TQueue         _TQueue;
43
44     public:
45       itkTypeMacro( IncrementalRegionGrow, RegionGrow );
46
47     public:
48       TGrowingFunction* GetGrowingFunction( unsigned int i );
49       const TGrowingFunction* GetGrowingFunction( unsigned int i ) const;
50       unsigned long GetGrowingFunctionVolume( unsigned int i ) const;
51       unsigned int GetNumberOfGrowingFunctions( ) const;
52       void ClearGrowingFunctions( );
53       unsigned int AddGrowingFunction( TGrowingFunction* function );
54
55     protected:
56       IncrementalRegionGrow( );
57       virtual ~IncrementalRegionGrow( );
58
59       virtual void _BeforeGenerateData( );
60       virtual void _AfterLoop( );
61       virtual void _Loop( );
62       virtual bool _CheckMembership( const TVertex& v ) const;
63
64     private:
65       // Purposely not implemented.
66       IncrementalRegionGrow( const Self& );
67       void operator=( const Self& );
68
69     protected:
70       mutable _TQueue m_AuxiliaryQueue;
71
72       TFunctions m_Functions;
73       TVolumes   m_Volumes;
74       unsigned int m_ActualFunction;
75     };
76
77   } // ecapseman
78
79 } // ecapseman
80
81 #include <fpa/Base/IncrementalRegionGrow.hxx>
82
83 #endif // __FPA__BASE__INCREMENTALREGIONGROW__H__
84
85 // eof - $RCSfile$