<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hello,<div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Brad</div><div><br></div><div>[1] <a href="http://www.itk.org/Doxygen/html/classitk_1_1LabelStatisticsImageFilter.html">http://www.itk.org/Doxygen/html/classitk_1_1LabelStatisticsImageFilter.html</a></div><div>[2] <a href="http://www.itk.org/Doxygen/html/classitk_1_1LabelStatisticsImageFilter.html#a971efb0a2d7dbd0f327bfec3f483d6ba">http://www.itk.org/Doxygen/html/classitk_1_1LabelStatisticsImageFilter.html#a971efb0a2d7dbd0f327bfec3f483d6ba</a></div><div><br></div><div><br></div><div><br></div><div><div><div>On May 13, 2014, at 6:37 AM, Mirco Serra <<a href="mailto:mirco9091@hotmail.it">mirco9091@hotmail.it</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="hmmessage" style="font-size: 12pt; font-family: Calibri; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div dir="ltr">Hi all,<div><br></div><div>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)?</div><div><br></div><div>Thank you very much,</div><div>MIrco</div></div>_____________________________________<br>Powered by<span class="Apple-converted-space"> </span><a href="http://www.kitware.com/">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br><a href="http://www.kitware.com/products/protraining.php">http://www.kitware.com/products/protraining.php</a><br><br>Please keep messages on-topic and check the ITK FAQ at:<br><a href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a></div></blockquote></div><br></div></body></html>