]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/Functors/GaussianModelEstimatorFunction.h
10178033fe397f77f8967ba5be99ddc96566446d
[FrontAlgorithms.git] / lib / fpa / Image / Functors / GaussianModelEstimatorFunction.h
1 #ifndef __FPA__IMAGE__FUNCTORS__GAUSSIANMODELESTIMATORFUNCTION__H__
2 #define __FPA__IMAGE__FUNCTORS__GAUSSIANMODELESTIMATORFUNCTION__H__
3
4 #include <cpPlugins/Extensions/Algorithms/IterativeGaussianModelEstimator.h>
5 #include <cpPlugins/Extensions/Algorithms/RGBToYPbPrFunction.h>
6 #include <itkFunctionBase.h>
7
8 namespace fpa
9 {
10   namespace Image
11   {
12     namespace Functors
13     {
14       /**
15        */
16       template< class I, class S >
17       class GaussianModelEstimatorFunction
18         : public itk::FunctionBase< typename I::PixelType, bool >
19       {
20       public:
21         // Type-related and pointers
22         typedef GaussianModelEstimatorFunction                   Self;
23         typedef itk::FunctionBase< typename I::PixelType, bool > Superclass;
24         typedef itk::SmartPointer< Self >                        Pointer;
25         typedef itk::SmartPointer< const Self >                  ConstPointer;
26
27         // Superclass' types
28         typedef cpPlugins::Extensions::Algorithms::IterativeGaussianModelEstimator< S, 3 > TEstimator;
29         typedef cpPlugins::Extensions::Algorithms::RGBToYPbPrFunction< S > TYPbPrFunction;
30
31       public:
32         itkNewMacro( Self );
33         itkTypeMacro( GaussianModelEstimatorFunction, itkFunctionBase );
34
35         itkGetConstMacro( ModelSupport, unsigned long );
36         itkSetMacro( ModelSupport, unsigned long );
37
38       public:
39         virtual bool Evaluate( const typename I::PixelType& rgb ) const;
40
41       protected:
42         GaussianModelEstimatorFunction( );
43         virtual ~GaussianModelEstimatorFunction( );
44
45       private:
46         // Purposely not implemented
47         GaussianModelEstimatorFunction( const Self& );
48         void operator=( const Self& );
49
50       protected:
51         typename TEstimator::Pointer m_Estimator;
52         TYPbPrFunction m_YPbPrFunction;
53
54         unsigned long m_ModelSupport;
55         mutable bool m_Estimating;
56       };
57
58     } // ecapseman
59
60   } // ecapseman
61
62 } // ecapseman
63
64 #include <fpa/Image/Functors/GaussianModelEstimatorFunction.hxx>
65
66 #endif // __FPA__IMAGE__FUNCTORS__GAUSSIANMODELESTIMATORFUNCTION__H__
67
68 // eof - $RCSfile$