]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/RegionGrowWithMultipleCriteria.h
...
[FrontAlgorithms.git] / lib / fpa / Base / RegionGrowWithMultipleCriteria.h
1 #ifndef __FPA__BASE__REGIONGROWWITHMULTIPLECRITERIA__H__
2 #define __FPA__BASE__REGIONGROWWITHMULTIPLECRITERIA__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 RegionGrowWithMultipleCriteria
17       : public RegionGrow< V, R, VV, VC, B >
18     {
19     public:
20       typedef V  TVertex;
21       typedef R  TResult;
22       typedef VV TVertexValue;
23       typedef B  TBaseFilter;
24
25       /// Standard class typdedefs
26       typedef RegionGrowWithMultipleCriteria  Self;
27       typedef RegionGrow< V, R, VV, VC, B >   Superclass;
28       typedef itk::SmartPointer< Self >       Pointer;
29       typedef itk::SmartPointer< const Self > ConstPointer;
30
31       typedef typename Superclass::TTraits  TTraits;
32       typedef typename Superclass::TCost    TCost;
33       typedef itk::FunctionBase< V, TCost > TMembershipFunction;
34       typedef
35       typename TMembershipFunction::Pointer
36       TMembershipFunctionPointer;
37       typedef std::vector< TMembershipFunctionPointer > TFunctions;
38
39     protected:
40       typedef typename Superclass::_TFrontId  _TFrontId;
41       typedef typename Superclass::_TNode     _TNode;
42       typedef typename Superclass::_TNodes    _TNodes;
43       typedef typename Superclass::_TQueue    _TQueue;
44       typedef typename Superclass::_TMarks    _TMarks;
45
46     public:
47       itkTypeMacro( RegionGrowWithMultipleCriteria, RegionGrow );
48
49     public:
50       unsigned int GetNumberOfMembershipFunctions( ) const;
51       void ClearMembershipFunctions( );
52       void AddMembershipFunction( TMembershipFunction* function );
53
54     protected:
55       RegionGrowWithMultipleCriteria( );
56       virtual ~RegionGrowWithMultipleCriteria( );
57
58       virtual void _BeforeMainLoop( );
59       virtual void _AfterLoop( );
60       virtual void _Loop( );
61       virtual bool _CheckMembership( const _TNode& n ) const;
62
63     private:
64       RegionGrowWithMultipleCriteria( const Self& ); // Not impl.
65       void operator=( const Self& );                 // Not impl.
66
67     protected:
68       mutable _TQueue m_AuxiliaryQueue;
69       TFunctions m_Functions;
70       typename TFunctions::iterator m_ActualFunction;
71     };
72
73   } // ecapseman
74
75 } // ecapseman
76
77 #ifndef ITK_MANUAL_INSTANTIATION
78 #include <fpa/Base/RegionGrowWithMultipleCriteria.hxx>
79 #endif // ITK_MANUAL_INSTANTIATION
80
81 #endif // __FPA__BASE__REGIONGROWWITHMULTIPLECRITERIA__H__
82
83 // eof - $RCSfile$