<div dir="ltr">Dear ITK developers,<div><br></div><div>I've found that the filter does not work even on the example code [1]. In this example, there are two Gaussian components defined, but the parameters of the second component is never updated. The reason is in the iktExpectationMaximizationMixtureModelEstimator.hxx, the UpdateComponentParameters function stops early. Here is the code that need to be changted. </div>
<div><br></div><div>_______________________________</div><div><div>template< typename TSample ></div><div>bool</div><div>ExpectationMaximizationMixtureModelEstimator< TSample ></div><div>::UpdateComponentParameters()</div>
<div>{</div><div> bool updated = false;</div><div> ComponentType *component;</div><div><br></div><div> for ( size_t componentIndex = 0; componentIndex < m_ComponentVector.size();</div><div> ++componentIndex )</div>
<div> {</div><div> component = m_ComponentVector[componentIndex];</div><div> component->Update();</div><div> if ( component->AreParametersModified() )</div><div> {</div><div> // return true;</div>
<div><span class="" style="white-space:pre"> </span> updated = true;</div><div> }</div><div> }</div><div><br></div><div> return updated;</div><div>}</div></div><div><br></div><div>_____________________________________________</div>
<div><br></div><div>We need to change the variable 'updated' instead of 'return true', otherwise, the remaining components can not get the parameters updated. After fixed, the example program works.</div><div>
<br></div><div><br></div><div>[1] <a href="http://www.itk.org/Wiki/ITK/Examples/Statistics/ExpectationMaximizationMixtureModelEstimator_2D">http://www.itk.org/Wiki/ITK/Examples/Statistics/ExpectationMaximizationMixtureModelEstimator_2D</a></div>
</div>