]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Extensions/Algorithms/IterativeGaussianModelEstimator.h
3e604d27b9d4e633f5578c8a61c668af68ea15ae
[cpPlugins.git] / lib / cpPlugins / Extensions / Algorithms / IterativeGaussianModelEstimator.h
1 // -------------------------------------------------------------------------
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // -------------------------------------------------------------------------
4
5 #ifndef __CPPLUGINS__EXTENSIONS__ALGORITHMS__ITERATIVEGAUSSIANMODELESTIMATOR__H__
6 #define __CPPLUGINS__EXTENSIONS__ALGORITHMS__ITERATIVEGAUSSIANMODELESTIMATOR__H__
7
8 #include <itkConceptChecking.h>
9 #include <itkObject.h>
10 #include <vnl/vnl_matrix.h>
11
12 namespace cpPlugins
13 {
14   namespace Extensions
15   {
16     namespace Algorithms
17     {
18       /**
19        */
20       template< class S, unsigned int D >
21       class IterativeGaussianModelEstimator
22         : public itk::Object
23       {
24       public:
25         typedef IterativeGaussianModelEstimator Self;
26         typedef itk::Object                     Superclass;
27         typedef itk::SmartPointer< Self >       Pointer;
28         typedef itk::SmartPointer< const Self > ConstPointer;
29
30         typedef S TScalar;
31         itkStaticConstMacro( Dimension, unsigned int, D );
32
33         // Begin concept checking
34 #ifdef ITK_USE_CONCEPT_CHECKING
35         itkConceptMacro(
36           ScalarTypeHasFloatResolution,
37           ( itk::Concept::IsFloatingPoint< S > )
38           );
39 #endif
40         // End concept checking
41
42         typedef vnl_matrix< S > TMatrix;
43
44       public:
45         itkNewMacro( Self );
46         itkTypeMacro( IterativeGaussianModelEstimator, itkObject );
47
48       public:
49         template< class V, class M >
50         void GetModel( V& m, M& E ) const;
51
52         void Clear( );
53
54         template< class V >
55         void AddSample( const V& sample );
56
57         void AddSample( const S& s_x, const S& s_y, ... );
58
59       protected:
60         IterativeGaussianModelEstimator( );
61         virtual ~IterativeGaussianModelEstimator( );
62
63       private:
64         // Purposely not implemented
65         IterativeGaussianModelEstimator( const Self& other );
66         void operator=( const Self& other );
67
68       protected:
69         unsigned long m_N;
70         TMatrix m_S1;
71         TMatrix m_S2;
72       };
73
74     } // ecapseman
75
76   } // ecapseman
77
78 } // ecapseman
79
80 #include <cpPlugins/Extensions/Algorithms/IterativeGaussianModelEstimator.hxx>
81
82 #endif // __CPPLUGINS__EXTENSIONS__ALGORITHMS__ITERATIVEGAUSSIANMODELESTIMATOR__H__
83
84 // eof - $RCSfile$