]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Base/RegionGrowWithMultipleCriteria.h
Multiple thresholds region grow segmentation almost added.
[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
45     public:
46       itkTypeMacro( RegionGrowWithMultipleCriteria, RegionGrow );
47
48     public:
49       unsigned int GetNumberOfMembershipFunctions( ) const;
50       void ClearMembershipFunctions( );
51       void AddMembershipFunction( TMembershipFunction* function );
52
53     protected:
54       RegionGrowWithMultipleCriteria( );
55       virtual ~RegionGrowWithMultipleCriteria( );
56
57       virtual void _BeforeLoop( );
58       virtual _TNode _QueuePop( );
59       virtual bool _CheckMembership( const _TNode& n ) const;
60
61     private:
62       RegionGrowWithMultipleCriteria( const Self& ); // Not impl.
63       void operator=( const Self& );                 // Not impl.
64
65     protected:
66       mutable _TQueue m_AuxiliaryQueue;
67       TFunctions m_Functions;
68       typename TFunctions::iterator m_ActualFunction;
69     };
70
71   } // ecapseman
72
73 } // ecapseman
74
75 #include <fpa/Base/RegionGrowWithMultipleCriteria.hxx>
76
77 #endif // __FPA__BASE__REGIONGROWWITHMULTIPLECRITERIA__H__
78
79 // eof - $RCSfile$