[ITK-dev] [ITK] expectationmaximizationMixtureModelEstimator bug
Matt McCormick
matt.mccormick at kitware.com
Tue Mar 18 23:04:22 EDT 2014
Hi Wei,
Great job locating the issue!
Could the example be place in a test for the
ExpectionMaximizationMixtureModelEstimator and the fix be place in a
patch so that you get proper credit for your work [1]? Please let us
know if you have any questions.
Thanks,
Matt
[1] http://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySoftwareProcess/SubmitAPatchToGerrit/index.html
On Tue, Mar 18, 2014 at 2:03 PM, Wei Liu <weiliu620 at gmail.com> wrote:
> 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
>
> _______________________________________________
> 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
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/community
>
More information about the Insight-developers
mailing list