]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Extensions/Algorithms/IterativeGaussianModelEstimator.h
Bezier function added.
[cpPlugins.git] / lib / cpPlugins / Extensions / Algorithms / IterativeGaussianModelEstimator.h
index 94e549571655054ce736be44a40461ed2f7bbd9c..017691e292548c3216a91376348ef0bffb017cb8 100644 (file)
@@ -47,14 +47,20 @@ namespace cpPlugins
         itkNewMacro( Self );
         itkTypeMacro( IterativeGaussianModelEstimator, itkObject );
 
-        itkGetConstMacro( MinimumProbability, S );
-        itkGetConstMacro( MaximumProbability, S );
-
       public:
         unsigned long GetNumberOfSamples( ) const
-          { return( this->m_Samples.size( ) ); }
+          { return( ( unsigned long )( this->m_N ) ); }
+        const TMatrix& GetMu( ) const
+          { return( this->m_M ); }
+        const TMatrix& GetOmega( ) const
+          { return( this->m_O ); }
+
+        void SetNumberOfSamples( unsigned long n );
+        void SetMu( const TMatrix& m );
+        void SetOmega( const TMatrix& O );
 
-        void UpdateModel( );
+        bool SaveModelToFile( const std::string& filename ) const;
+        bool LoadModelFromFile( const std::string& filename );
 
         template< class V >
         S Probability( const V& sample ) const;
@@ -75,24 +81,23 @@ namespace cpPlugins
         IterativeGaussianModelEstimator( );
         virtual ~IterativeGaussianModelEstimator( );
 
+      protected:
+        void _UpdateModel( ) const;
+
       private:
         // Purposely not implemented
         IterativeGaussianModelEstimator( const Self& other );
         void operator=( const Self& other );
 
       protected:
-        TMatrix   m_S1;
-        TMatrix   m_S2;
-        TMatrices m_Samples;
-
-        bool m_Updated;
-        TMatrix m_Cov;
-        TMatrix m_Mean;
-        TMatrix m_InvCov;
-        S m_DensityCoeff;
-
-        S m_MinimumProbability;
-        S m_MaximumProbability;
+        S m_N;
+        TMatrix m_M;
+        TMatrix m_O;
+
+        mutable bool m_Updated;
+        mutable TMatrix m_Cov;
+        mutable TMatrix m_Inv;
+        mutable S m_Norm;
       };
 
     } // ecapseman