]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/RegionGrowWithMultipleThresholds.h
41fba37baae72af994d8b7881600a8e30f0f504c
[FrontAlgorithms.git] / lib / fpa / Image / RegionGrowWithMultipleThresholds.h
1 #ifndef __FPA__IMAGE__REGIONGROWWITHMULTIPLETHRESHOLDS__H__
2 #define __FPA__IMAGE__REGIONGROWWITHMULTIPLETHRESHOLDS__H__
3
4 #include <map>
5 #include <fpa/Image/RegionGrowWithMultipleCriteria.h>
6
7 namespace fpa
8 {
9   namespace Image
10   {
11     /**
12      * @param I Input image type
13      */
14     template< class I >
15     class RegionGrowWithMultipleThresholds
16       : public RegionGrowWithMultipleCriteria< I >
17     {
18     public:
19       typedef RegionGrowWithMultipleThresholds    Self;
20       typedef RegionGrowWithMultipleCriteria< I > Superclass;
21       typedef itk::SmartPointer< Self >           Pointer;
22       typedef itk::SmartPointer< const Self >     ConstPointer;
23
24       typedef typename I::PixelType TPixel;
25
26       typedef std::map< TPixel, unsigned long >        THistogram;
27       typedef typename Superclass::TBaseAlgorithm      TBaseAlgorithm;
28       typedef typename Superclass::TMembershipFunction TMembershipFunction;
29       typedef typename Superclass::TFunctions          TFunctions;
30
31     protected:
32       typedef typename TBaseAlgorithm::_TNode _TNode;
33
34     public:
35       itkNewMacro( Self );
36       itkTypeMacro( RegionGrowWithMultipleThresholds, RegionGrow );
37
38       itkGetConstMacro( DerivativeThreshold, double );
39       itkSetMacro( DerivativeThreshold, double );
40
41     public:
42       void AddThreshold( const TPixel& v );
43       void AddThresholds(
44         const TPixel& t0,
45         const TPixel& t1,
46         const unsigned int& s
47         );
48
49     protected:
50       RegionGrowWithMultipleThresholds( );
51       virtual ~RegionGrowWithMultipleThresholds( );
52
53       virtual bool _UpdateResult( _TNode& n );
54       virtual void _BeforeLoop( );
55       virtual void _AfterLoop( );
56
57     private:
58       RegionGrowWithMultipleThresholds( const Self& ); // Not impl.
59       void operator=( const Self& );                   // Not impl.
60
61     protected:
62       double m_DerivativeThreshold;
63       THistogram m_Histogram;
64     };
65
66   } // ecapseman
67
68 } // ecapseman
69
70 #include <fpa/Image/RegionGrowWithMultipleThresholds.hxx>
71
72 #endif // __FPA__IMAGE__REGIONGROWWITHMULTIPLETHRESHOLDS__H__
73
74 // eof - $RCSfile$