[ITK] [ITK-dev] expectationmaximizationMixtureModelEstimator bug
Wei Liu
weiliu620 at gmail.com
Tue Mar 18 14:03:55 EDT 2014
Dear ITK developers,
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.
_______________________________
template< typename TSample >
bool
ExpectationMaximizationMixtureModelEstimator< TSample >
::UpdateComponentParameters()
{
bool updated = false;
ComponentType *component;
for ( size_t componentIndex = 0; componentIndex <
m_ComponentVector.size();
++componentIndex )
{
component = m_ComponentVector[componentIndex];
component->Update();
if ( component->AreParametersModified() )
{
// return true;
updated = true;
}
}
return updated;
}
_____________________________________________
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.
[1]
http://www.itk.org/Wiki/ITK/Examples/Statistics/ExpectationMaximizationMixtureModelEstimator_2D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140318/b940bfb0/attachment.html>
-------------- next part --------------
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Kitware offers ITK Training Courses, for more information visit:
http://kitware.com/products/protraining.php
Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-developers
More information about the Community
mailing list