Dear itk-developers,<br><br>Studying and debugging a few itk classes related to the expectation maximization, I have noticed the following: (a) in the file itkGaussianMixtureModelComponent.hxx there are some unnecessary lines of codes (b) in the file itkExpectationMaximizationMixtureModelEstimator.hxx there is a small bug - the class variable m_TerminationCode is always set to NOT_CONVERGED. <br>
<br>Please take a look on the pieces of code I have copied bellow.<br><br>Best wishes,<br>Ricardo<br><br>PS: I would still be very grateful if somebody could guide me when extending the EM algorithm to deal with t-student mixture components. <br>
<br><br>/// *************************************************************<br>/// UNNECESSARY LINES OF CODE<br>/// *************************************************************<br>///<br>/// File: itkGaussianMixtureModelComponent.hxx<br>
///<br>/// *************************************************************<br><br><br>// typename TSample::ConstIterator iter = this->GetSample()->Begin();<br>// typename TSample::ConstIterator end = this->GetSample()->End();<br>
<br>// typename TSample::MeasurementVectorType measurements;<br>
<br> // why these lines???<br>// while ( iter != end )<br>// {<br>// measurements = iter.GetMeasurementVector();<br>// ++iter;<br>// }<br><br><br><br>/// *************************************************************<br>
/// SMALL BUG CORRECTION<br>/// *************************************************************<br>///<br>/// File: itkExpectationMaximizationMixtureModelEstimator.hxx<br>///<br>/// *************************************************************<br>
<br><br>template< class TSample ><br>
void<br>ExpectationMaximizationMixtureModelEstimator< TSample ><br>::GenerateData()<br>{<br> m_Proportions = m_InitialProportions;<br><br> int iteration = 0;<br>
m_CurrentIteration = 0;<br><br> ///<br> /// The following line was move from the end of this function <br> /// to here. The way it was before, the m_TerminationCode variable<br> /// was always set to NOT_CONVERGED<br>
///<br> m_TerminationCode = NOT_CONVERGED;<br><br> while ( iteration < m_MaxIteration )<br> {<br> m_CurrentIteration = iteration;<br> if ( this->CalculateDensities() )<br> {<br>
this->UpdateComponentParameters();<br> this->UpdateProportions();<br> }<br> else<br> {<br> m_TerminationCode = CONVERGED;<br> break; <br> }<br> ++iteration;<br> }<br><br>}<br clear="all">
<br>-- <br>---------<br>Ricardo J. Ferrari, Ph.D. - Assistant Professor<br>Federal University of São Carlos<br>Rod. Washington Luís, Km 235<br>
Caixa Postal 676 - 13565-905 São Carlos-SP - Brazil<br>
Work Phone: <a href="tel:%2B55%20%2816%29%203306-6607" value="+551633066607" target="_blank">+55 (16) 3306-6607</a> ; Fax: <a href="tel:%2B55%20%2816%29%203351-8233" value="+551633518233" target="_blank">+55 (16) 3351-8233</a><br>
<a href="http://www.dc.ufscar.br/" target="_blank">http://www.dc.ufscar.br/</a><br>---------<br>