]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/RegionGrowWithMultipleThresholds.h
3efd87a7313547b97e2413205e73fd47ee42a213
[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/RegionGrow.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 RegionGrow< I >
17     {
18     public:
19       typedef RegionGrowWithMultipleThresholds Self;
20       typedef RegionGrow< 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
29     protected:
30       typedef typename TBaseAlgorithm::_TNode _TNode;
31
32     public:
33       itkNewMacro( Self );
34       itkTypeMacro( RegionGrowWithMultipleThresholds, RegionGrow );
35
36       itkGetConstMacro( DerivativeThreshold, double );
37       itkSetMacro( DerivativeThreshold, double );
38
39     public:
40       void AddThreshold( const TPixel& v );
41       void AddThresholds(
42         const TPixel& t0,
43         const TPixel& t1,
44         const unsigned int& s
45         );
46
47     protected:
48       RegionGrowWithMultipleThresholds( );
49       virtual ~RegionGrowWithMultipleThresholds( );
50
51       virtual bool _UpdateResult( _TNode& n );
52       virtual void _AfterLoop( );
53
54     private:
55       RegionGrowWithMultipleThresholds( const Self& ); // Not impl.
56       void operator=( const Self& );                   // Not impl.
57
58     protected:
59       double m_DerivativeThreshold;
60       THistogram m_Histogram;
61     };
62
63   } // ecapseman
64
65 } // ecapseman
66
67 #include <fpa/Image/RegionGrowWithMultipleThresholds.hxx>
68
69 #endif // __FPA__IMAGE__REGIONGROWWITHMULTIPLETHRESHOLDS__H__
70
71 // eof - $RCSfile$