[ITK] Problem with LabelShapeStatisticsImageFilter

Ehsan Dehghan ehsand56 at gmail.com
Tue May 10 14:45:32 EDT 2016


I'm using LabelShapeStatisticsImageFilter with Java to get statistics on a
labeled image. I use the following code:

LabelShapeStatisticsImageFilter labelStat = new
LabelShapeStatisticsImageFilter();
labelStat.execute(slice, 0, false, false);

int labelsCount = (int) labelStat.getLabels().size();
int n  = (int) labelStat.getNumberOfLabels();
volPix = labelStat.getNumberOfPixels(1);


In the above code labelsCount will be calculated correctly. The value for
"n" which should be equal to labelsCount is a huge and wrong number
(=252578752). Surprisingly "volPix" is also equal to "n". Slice is a
512*512 image of UInt.

Any help is much appreciated.

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160510/ba05192b/attachment.html>


More information about the Community mailing list