[ITK] Problem with LabelShapeStatisticsImageFilter
Lowekamp, Bradley (NIH/NLM/LHC) [C]
blowekamp at mail.nih.gov
Wed May 11 09:07:33 EDT 2016
Hello,
Did you compile SimpleITK yourself? What OS, architecture and Java version are you using?
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?
HTH,
Brad
[1] https://itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1LabelShapeStatisticsImageFilter.html
> On May 10, 2016, at 2:45 PM, Ehsan Dehghan <ehsand56 at gmail.com> wrote:
>
> 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.
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
More information about the Community
mailing list