1 #ifndef __FPA__IMAGE__FUNCTORS__GAUSSIANMODELESTIMATORFUNCTION__H__
2 #define __FPA__IMAGE__FUNCTORS__GAUSSIANMODELESTIMATORFUNCTION__H__
4 #include <cpPlugins/Extensions/Algorithms/IterativeGaussianModelEstimator.h>
5 #include <cpPlugins/Extensions/Algorithms/RGBToYPbPrFunction.h>
6 #include <itkFunctionBase.h>
16 template< class I, class S >
17 class GaussianModelEstimatorFunction
18 : public itk::FunctionBase< typename I::PixelType, bool >
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;
28 typedef cpPlugins::Extensions::Algorithms::IterativeGaussianModelEstimator< S, 3 > TEstimator;
29 typedef cpPlugins::Extensions::Algorithms::RGBToYPbPrFunction< S > TYPbPrFunction;
33 itkTypeMacro( GaussianModelEstimatorFunction, itkFunctionBase );
35 itkGetConstMacro( ModelSupport, unsigned long );
38 bool SaveModelToFile( const std::string& filename ) const;
39 bool LoadModelFromFile( const std::string& filename );
41 virtual void SetModelSupport( const unsigned long& s );
42 virtual bool Evaluate( const typename I::PixelType& rgb ) const;
45 GaussianModelEstimatorFunction( );
46 virtual ~GaussianModelEstimatorFunction( );
49 // Purposely not implemented
50 GaussianModelEstimatorFunction( const Self& );
51 void operator=( const Self& );
54 typename TEstimator::Pointer m_Estimator;
55 TYPbPrFunction m_YPbPrFunction;
57 unsigned long m_ModelSupport;
58 unsigned long m_RealModelSupport;
59 mutable bool m_Estimating;
68 #include <fpa/Image/Functors/GaussianModelEstimatorFunction.hxx>
70 #endif // __FPA__IMAGE__FUNCTORS__GAUSSIANMODELESTIMATORFUNCTION__H__