<div dir="ltr"><div><div><div>I'm using LabelShapeStatisticsImageFilter with Java to get statistics on a labeled image. I use the following code:<br><br>LabelShapeStatisticsImageFilter labelStat = new LabelShapeStatisticsImageFilter();<br>labelStat.execute(slice, 0, false, false);<br><br>int labelsCount = (int) labelStat.getLabels().size();<br>int n  = (int) labelStat.getNumberOfLabels();<br>volPix = labelStat.getNumberOfPixels(1);<br><br><br></div>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.<br><br></div>Any help is much appreciated.<br><br></div>Thanks.<br></div>