]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Extensions/Algorithms/IterativeGaussianModelEstimator.h
148fee9d9bffedf4dc52cedfb03b8bd254810091
[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         const unsigned long& GetNumberOfSamples( ) const
50           { return( this->m_N ); }
51
52         template< class V, class M >
53         void GetModel( V& m, M& E ) const;
54
55         void Clear( );
56
57         template< class V >
58         void AddSample( const V& sample );
59
60         void AddSample( const S& s_x, const S& s_y, ... );
61
62       protected:
63         IterativeGaussianModelEstimator( );
64         virtual ~IterativeGaussianModelEstimator( );
65
66       private:
67         // Purposely not implemented
68         IterativeGaussianModelEstimator( const Self& other );
69         void operator=( const Self& other );
70
71       protected:
72         unsigned long m_N;
73         TMatrix m_S1;
74         TMatrix m_S2;
75       };
76
77     } // ecapseman
78
79   } // ecapseman
80
81 } // ecapseman
82
83 #include <cpPlugins/Extensions/Algorithms/IterativeGaussianModelEstimator.hxx>
84
85 #endif // __CPPLUGINS__EXTENSIONS__ALGORITHMS__ITERATIVEGAUSSIANMODELESTIMATOR__H__
86
87 // eof - $RCSfile$