View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008893ITKpublic2009-04-16 11:002010-12-15 14:10
ReporterBradley Lowekamp 
Assigned ToLuis Ibanez 
PrioritynormalSeveritymajorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in VersionITK-4-A3 
Summary0008893: RefactorStatistics MeanFilter and CovariantFilter may compute wrong value, no MeasurementVector AccumulateType
DescriptionThe precision of computing the mean and variance vary from poor to wrong, because a basic summation algorithm is used with the templated MeasurementVector as the accumulator.

The following filter may contain this bug:

itkCovarianceFilter
itkMeanFilter
itkStandardDeviationPerComponentFilter
itkWeightedCovarianceFilter
itkWeightedMeanFilter

It is likely that a AccumulateType needs to be defined in some traits for MeasurementVectors and then utilized for these algorithms.

Additional InformationAdditional consideration needs to be made for large data sets. An improved summation algorithm such as Kahan Summation may be appropriate for these methods.

I also conjecture that likely hood that these methods are bound by main memory bandwidth and not computation, the additional over head of this type of algorithm would be minimal for most cases.

It is also possible to implement this algorithm as a new type, and wrap the detail in a class exposing just basic =,+,+=, copy, etc. operators.
TagsNo tags attached.
Resolution Date2010-12-15
Sprint
Sprint Statusbacklog
Attached Files

 Relationships
parent of 0011609assignedBradley Lowekamp MeanFilter and CovariantFilter : Precision : Need Kahan Summation 
Not all the children of this issue are yet resolved or closed.

  Notes
(0023004)
Luis Ibanez (manager)
2010-11-07 02:25

I had a patch for this just before we moved from CVS to Git.

It was the kind of change that "git branches" will have made very easy to manage.

will have to dig it back...
(0023720)
Luis Ibanez (manager)
2010-12-05 11:09

Pushed patch to Gerrit with a fix.

http://review.source.kitware.com/#change,506 [^]

This fixes the use of numeric traits (Real and Accumulate) for the internal computation of means.

The code could still benefit from addressing the issue of precision loss for very large samples, e.g. using Kahan Summation as Brad suggested.

http://en.wikipedia.org/wiki/Kahan_summation_algorithm#The_algorithm [^]
(0024173)
Luis Ibanez (manager)
2010-12-15 12:11

Moved the Kahan Summation to a new bug: 11609.
to be addressed separately.
(0024181)
Luis Ibanez (manager)
2010-12-15 14:10

http://review.source.kitware.com/#change,506 [^]
Merged

 Issue History
Date Modified Username Field Change
2009-04-16 11:00 Bradley Lowekamp New Issue
2009-04-16 11:00 Bradley Lowekamp Assigned To => Karthik Krishnan
2009-04-16 11:00 Bradley Lowekamp Status new => assigned
2009-05-15 13:07 Bradley Lowekamp Severity minor => major
2010-10-21 11:20 Hans Johnson Assigned To Karthik Krishnan => Luis Ibanez
2010-11-07 02:25 Luis Ibanez Note Added: 0023004
2010-12-05 11:09 Luis Ibanez Note Added: 0023720
2010-12-15 12:08 Luis Ibanez Relationship added parent of 0011609
2010-12-15 12:11 Luis Ibanez Note Added: 0024173
2010-12-15 14:10 Luis Ibanez Resolution Date => 2010-12-15
2010-12-15 14:10 Luis Ibanez Sprint Status => backlog
2010-12-15 14:10 Luis Ibanez Note Added: 0024181
2010-12-15 14:10 Luis Ibanez Status assigned => closed
2010-12-15 14:10 Luis Ibanez Resolution open => fixed
2010-12-15 14:10 Luis Ibanez Fixed in Version => ITK-4-A3


Copyright © 2000 - 2018 MantisBT Team