[ITK] Problem with LabelShapeStatisticsImageFilter

Ehsan Dehghan ehsand56 at gmail.com
Wed May 11 12:46:22 EDT 2016


Hi Brad,

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.

Thanks,
Ehsan

On Wed, May 11, 2016 at 6:07 AM, Lowekamp, Bradley (NIH/NLM/LHC) [C] <
blowekamp at mail.nih.gov> wrote:

> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160511/c107feaa/attachment.html>


More information about the Community mailing list