[ITK-users] Bug in StatisticsImageFilter?

Bradley Lowekamp blowekamp at mail.nih.gov
Tue May 13 08:53:16 EDT 2014


Hello,

This is not a bug. I think the confusion comes from the concept of a binary image. This StatisticsImageFilter is does not consider you image to be binary.

In the StatisticsImageFilter, the Sum is the sum of all the pixels. It's is expected that the Sum( c*I ) = c*Sum( I ), where I is the image.

It seems that the LabelStatisticsImageFilter[1] may be more what you are looking for it has a GetCount[2] method which counts the number of pixels for a give label.

Brad

[1] http://www.itk.org/Doxygen/html/classitk_1_1LabelStatisticsImageFilter.html
[2] http://www.itk.org/Doxygen/html/classitk_1_1LabelStatisticsImageFilter.html#a971efb0a2d7dbd0f327bfec3f483d6ba



On May 13, 2014, at 6:37 AM, Mirco Serra <mirco9091 at hotmail.it> wrote:

> Hi all,
> 
> I was trying to use the itkStatisticsImageFilter to count the number of voxels of a binary image as results of  segmentation. However, the function GetSum() seems to be multiplying the number of voxels by the integer value that I'm using for the segmentation. As an example, if I decide to give a value of 2 to the voxels which are part of the segmentation, then the voxels count will be the double of what it should really be,  if I give a value of 3 it will the triple and so forth...Is this normal? Is there a way to fix it (apart from dividing by the value the voxels count)?
> 
> Thank you very much,
> MIrco
> _____________________________________
> 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://www.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-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20140513/ccd353ad/attachment.html>


More information about the Insight-users mailing list