[Insight-users] GaussianMixtureModelComponent set parameters when the measurments vector has dimension>1

Luis Ibanez luis.ibanez at kitware.com
Thu Mar 12 10:35:39 EDT 2009


Hi Baoyun,



      "A Glimpse to the Source, Leaves no Doubt"



If you look at the file:

     Insight/Code/Numerics/Statistics/
         itkGaussianMixtureModelComponent.txx

in lines 93 - 115:


you will find:


   for ( i = 0 ; i < measurementVectorSize ; i++)
     {
     if ( m_Mean[i] != parameters[paramIndex] )
       {
       m_Mean[i] = parameters[paramIndex] ;
       changed = true ;
       }
     ++paramIndex ;
     }

   for ( i = 0 ; i < measurementVectorSize ; i++ )
     {
     for ( j = 0 ; j < measurementVectorSize; j++ )
       {
       if ( m_Covariance.GetVnlMatrix().get(i, j) !=
            parameters[paramIndex] )
         {
         m_Covariance.GetVnlMatrix().put(i, j, parameters[paramIndex]) ;
         changed = true ;
         }
       ++paramIndex ;
       }
     }


This is how your input Parameters vector is going to
be feed to the GaussianMixtureComponent.

So, in your case, if your MeasurementVectorType has size = 3,

Then the parameters array length must be (as you already pointed out),

       mean = 3 components

    plus

       covariance = 3x3 = 9 components

for a total of : 12 components.

As you can see from the code above, the first three components
are the Mean, and the following nine components will be the
elements of the Covariance Matrix.



      Regards,


         Luis



-----------------
Baoyun Li wrote:
> Dear All:
>  
> Can somebody have experience to SetParameters for  
> GaussianMixtureModelComponent class?
>  
> ITK statistic example is for one dimension MesuremenVector, thus
>   typedef itk::Array< double > ParametersType;
>   ParametersType params( 2 );
>  
> params(2) containing mean and variation are enough.
>  
>  
> Now my measurement vection is 3x1.
>  
> so the mean is 3x1, and the covariance  matrix should be 3x3.
>  
> How should I give this intial parameters in this case? Only mean value 
> for each component ok? (I tried only give means, at least, the program 
> can be build).
>  
> Can somebody teach me?
>  
> Thanks
>  
> Baoyun
> 


More information about the Insight-users mailing list