<div dir="ltr"><div><div><div>Hi Brad,<br><br></div>I did not compile simpleITK myself. I am using version 0.9.0 on Windows 7, 64 bits. I am running Java 1.7.0. Both of these methods return Long.<br><br></div>Thanks,<br></div>Ehsan<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 11, 2016 at 6:07 AM, Lowekamp, Bradley (NIH/NLM/LHC) [C] <span dir="ltr"><<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
Did you compile SimpleITK yourself? What OS, architecture and Java version are you using?<br>
<br>
Looking at this filter [1], I see both of these problematic methods are returning “uint64_t” in C++. There appears to be some problem with the conversion of integers. What is the return type in your Java for getNumberOfLabels()? Is may be BigInteger?<br>
<br>
HTH,<br>
Brad<br>
<br>
<br>
[1] <a href="https://itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1LabelShapeStatisticsImageFilter.html" rel="noreferrer" target="_blank">https://itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1LabelShapeStatisticsImageFilter.html</a><br>
<br>
<br>
> On May 10, 2016, at 2:45 PM, Ehsan Dehghan <<a href="mailto:ehsand56@gmail.com">ehsand56@gmail.com</a>> wrote:<br>
><br>
> 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>
> 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>
> Any help is much appreciated.<br>
><br>
> Thanks.<br>
> _______________________________________________<br>
> Community mailing list<br>
> <a href="mailto:Community@itk.org">Community@itk.org</a><br>
> <a href="http://public.kitware.com/mailman/listinfo/community" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/community</a><br>
<br>
</blockquote></div><br></div>