[Insight-users] Why are getBufferAs* methods not available in Java?

Zamir Khan zamir.khan at gmail.com
Mon May 6 09:01:05 EDT 2013


Hi Dan,

Thank you for investigating and confirming the issue. I would like to look
into this more at some point, but that will have to wait until some time
opens up. It'd also be my first experience with SWIG, but I consider that a
learning opportunity. For now that these functions are missing represents
an inconvenience for me rather than a showstopper.

Thanks,
Zamir


On Fri, May 3, 2013 at 5:54 PM, Dan Mueller <dan.muel at gmail.com> wrote:

> Hi Zamir,
>
> I downloaded the latest SimpleITK C# binaries (
> SimpleITK-0.6.1.post2-CSharp-win32-x86.zip) and can confirm that the
> getBufferAs* methods are missing.
>
> This has revealed a hole in the automated testing.
>
> A number of things need to happen:
> 1. A (C#) test needs to be added which uses these functions (probably
> to Testing/Unit/CSharpImageTest.cs).
> 2. The cause of the missing functions needs to be identified and fixed.
>
> I've had a quick look at the code and can't work this out — everything
> seems in order. There is a C++ test which exercises the methods (so
> they exist in C++ world), and SimpleITK.i contains the lines:
>
> #ifndef CSHARP
> %ignore itk::simple::Image::GetBufferAsInt8;
> %ignore itk::simple::Image::GetBufferAsUInt8;
> %ignore itk::simple::Image::GetBufferAsInt16;
> %ignore itk::simple::Image::GetBufferAsUInt16;
> %ignore itk::simple::Image::GetBufferAsInt32;
> %ignore itk::simple::Image::GetBufferAsUInt32;
> %ignore itk::simple::Image::GetBufferAsInt64;
> %ignore itk::simple::Image::GetBufferAsUInt64;
> %ignore itk::simple::Image::GetBufferAsFloat;
> %ignore itk::simple::Image::GetBufferAsDouble;
> #endif
>
> So I don't understand...
>
> Unfortunately I am flat out at the moment and won't have a chance to
> look further for a while. If you want to investigate yourself, we
> welcome any contribution!
>
> Thanks for reporting the issue and sorry for the delay in responding.
>
> Regards, Dan
>
>
> On 3 May 2013 01:05, "Zamir Khan" <zamir.khan at gmail.com> wrote:
> >
> > I am primarily working with VS2010, .NET 4.0, x64, if that helps.
> >
> > Thanks,
> > Zamir
> >
> >
> > On Thu, May 2, 2013 at 11:34 AM, Zamir Khan <zamir.khan at gmail.com>
> wrote:
> >>
> >> Can anyone confirm whether they have access to the GetBufferAs* methods
> in the C# wrappers of SimpleITK in v0.6.1 or later?
> >>
> >> Thanks,
> >> Zamir
> >>
> >>
> >> On Tue, Apr 30, 2013 at 11:26 AM, Zamir Khan <zamir.khan at gmail.com>
> wrote:
> >>>
> >>> Sorry, I'm not sure what is meant by "compile distribution". If you
> mean the 0.6.1 release binaries, that is what I started with (and what led
> me to build from the source). In both versions, I do not see any buffer
> related methods for the Image object in the C# wrappers (using the object
> explorer and Intellisense).
> >>>
> >>> On an unrelated note, I also found a strange discrepancy that I could
> use Image.GetPixelID() in the x64 version, but not the x86 version.
> >>>
> >>> Thanks,
> >>> Zamir
> >>>
> >>>
> >>> On Tue, Apr 30, 2013 at 11:14 AM, Bradley Lowekamp <
> blowekamp at mail.nih.gov> wrote:
> >>>>
> >>>> Hello Zkhan,
> >>>>
> >>>> Those methods should still be there.  Are you able to find them in
> the compile distribution?
> >>>>
> >>>> I checked to see if there was a test for those methods in C# and I
> didn't see them any place. So I can't confirm that they are being tested
> nightly.
> >>>>
> >>>> Brad
> >>>>
> >>>> On Apr 30, 2013, at 8:44 AM, zkhan <zamir.khan at gmail.com> wrote:
> >>>>
> >>>> > Sorry to revive an old-ish thread, but I read here that the
> GetBufferAs*
> >>>> > methods are implemented for C#. However, I just pulled and built
> SimpleITK
> >>>> > 0.7.32799.0 and I cannot find any methods to retrieve a buffer from
> the
> >>>> > image. As has been mentioned, this would provide a significant
> performance
> >>>> > improvement over having to access the image pixel-by-pixel when
> needing to
> >>>> > transfer the image data outside of the Image object.
> >>>> >
> >>>> > Have these methods been removed, or not yet implemented?
> >>>> >
> >>>> >
> >>>> >
> >>>> > --
> >>>> > View this message in context:
> http://itk-users.7.n7.nabble.com/Why-are-getBufferAs-methods-not-available-in-Java-tp30969p31309.html
> >>>> > Sent from the ITK - Users mailing list archive at Nabble.com.
> >>>> > _____________________________________
> >>>> > Powered by www.kitware.com
> >>>> >
> >>>> > Visit other Kitware open-source projects at
> >>>> > http://www.kitware.com/opensource/opensource.html
> >>>> >
> >>>> > Kitware offers ITK Training Courses, for more information visit:
> >>>> > http://www.kitware.com/products/protraining.php
> >>>> >
> >>>> > Please keep messages on-topic and check the ITK FAQ at:
> >>>> > http://www.itk.org/Wiki/ITK_FAQ
> >>>> >
> >>>> > Follow this link to subscribe/unsubscribe:
> >>>> > http://www.itk.org/mailman/listinfo/insight-users
> >>>>
> >>>
> >>
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130506/7b7bb619/attachment.htm>


More information about the Insight-users mailing list