What's the difference between vtkImageHistogramStatistics and vtkImageAccumulate?

VTkImageHistoramStatistics and VTkImageAccumulate can both collect image information. What is the difference?

1 Like

For multi-component (e.g. RGB images), ImageAccumulate produces a multi-dimensional histogram, while HistogramStatistics requires you to choose a component, and then produces a 1D histogram for the chosen component.

Both filters have a SetStencilData() method that allows you to specify a region of interest over which to compute the histogram and the statistics.

HistogramStatistics is a multithreaded filter, ImageAccumulate is not.

Finally, the way they compute the mean and standard deviation is different. ImageAccumulate computes the sum and sum^2 of the pixel values as it iterates over the pixels. HistogramStatistics generates the histogram first, and then computes the sums from the histogram. The histogram method is more robust, particularly for very large images.

1 Like

I understand now, thank you very much!