]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/RegionGrowWithMultipleThresholds.h
First commit
[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, const TPixel& t1,
43         const unsigned int& samples
44         );
45
46     protected:
47       RegionGrowWithMultipleThresholds( );
48       virtual ~RegionGrowWithMultipleThresholds( );
49
50       virtual bool _UpdateResult( _TNode& n );
51       virtual void _AfterLoop( );
52
53     private:
54       RegionGrowWithMultipleThresholds( const Self& ); // Not impl.
55       void operator=( const Self& );                   // Not impl.
56
57     protected:
58       double m_DerivativeThreshold;
59       THistogram m_Histogram;
60     };
61
62   } // ecapseman
63
64 } // ecapseman
65
66 #include <fpa/Image/RegionGrowWithMultipleThresholds.hxx>
67
68 #endif // __FPA__IMAGE__REGIONGROWWITHMULTIPLETHRESHOLDS__H__
69
70 // eof - $RCSfile$