[Insight-users] Minor Bug in itkExpectationMaximizationMixtureModelEstimator.txx

Jonathan Orban orban at tele.ucl.ac.be
Wed Apr 18 09:09:20 EDT 2007


Hello itk users and developers,


I suggest a small change in the
itkExpectationMaximizationMixtureModelEstimator.txx filter. 

I tested the ExpectationMaximizationMixtureModelEstimator.cxx with
different initial parameters than the one proposed to simulate the case
where one has not to much information on the distribution (especially on
the variance of the gaussian). 

I changed the variance in the initialParameters 

line 194 : params[1] = 5.0; //instead of 800.0

line 198 : params[1] = 5.0; //instead of 850.0

This gives a problem during the execution of the program returning a
"nan" as proportion for both distributions after 5 iterations.

I think that this comes from the fact that some points lay out of the
estimation of both distributions. Therefore, the densitySum computed at
line 184 of the itkExpectationMaximizationMixtureModelEstimator.txx is
equal to zero. As the weight (named temp) is divided by the value
densitySum at line 191 of the filter. This returns a "nan" for the
weight associated to the points.

I suggest the change of line 191:

        temp /= densitySum ;

by

        if (densitySum==0.0)
        {
        temp = 0.0;
        }
        else
        {
        temp /= densitySum ;
        }

This change lets the algorithm finish correctly even if some values lie
out of the estimated distributions.


Do you agree with this change?




Best Regards,


Jonathan Orban

--------------
Telecommunications and Remote Sensing laboratory
Université catholique de Louvain
Place du Levant, 2
1348 Louvain-la-Neuve
Belgium



More information about the Insight-users mailing list