[Insight-users] Re: Exception Access Violation w/ java bindings
Blair Cruz
blair.cruz at gmail.com
Thu Jan 18 20:11:38 EST 2007
Never mind, I figured it out. I had to create a itkImageF3_Pointer with the
original itkImageF3 to access the data.
On 1/18/07, Blair Cruz <blair.cruz at gmail.com> wrote:
>
> Hello All,
> I'm running ITK with the Java bindings to do some registration in a Java
> application I'm developing. I'm running into an EXCEPTION_ACCESS_VIOLATION
> when using the Java bindings. Here is whats happening.
>
> I create two itkImportImageFilterF3_Pointer objects for the fixedImage and
> movingImage. I populate these objects with the image data I need to
> register. I then create the code to do the registration and pass the
> filters to it. Eventually, I get back a itkImageF3 by calling:
>
> itkResampleImageFilterF3F3_Pointer.GetOutput() (by calling the instance
> of the resampling filter)
>
> Then with the itkImageF3 object I read the data out of it. I do that by
> calling:
>
> output.GetPixel(itkindex3_1 )
>
> Where output us the itkImageF3 I get back from the resampling filter. I
> can do this consistantly with no problems unless I allocate a large array to
> read into before I read the data from the itkImageF3. If I allocate a large
> array anytime before I read the itkImageF3 I get the
> EXCEPTION_ACCESS_VIOLATION. With the large array allocated ITK will step on
> my memory. It's also random when it blows up, sometimes reading 6 or 600
> pixel values out of the itkImageF3.
>
> I also get the exceptions if I create the itkImageF3 object and write
> image data to it, then read it out right after.
>
> I have been able to successfully read all the pixel values out of the
> registered itkImageF3 and display them to verify that the image was
> registering. I did this with a small class that I developed the
> registration code with. Once I moved it to the real application I get the
> exceptions.
>
> I'm in desperate need of help with this. I need to get cross platform
> registration working in my application and this appears to be the way to do
> it. Please let me know if you can help me on this issue.
>
> Here is the exception I'm getting:
>
> #
> # An unexpected error has been detected by HotSpot Virtual Machine:
> #
> # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0b671da3, pid=8748,
> tid=9484
> #
> # Java VM: Java HotSpot(TM) Client VM ( 1.5.0_04-b05 mixed mode)
> # Problematic frame:
> # C [ITKCommonAJava.dll+0x241da3]
> #
> # An error report file with more information is saved as
> hs_err_pid8748.log
> #
> # If you would like to submit a bug report, please visit:
> # http://java.sun.com/webapps/bugreport/crash.jsp
> #
>
> Platform: WIndows XP SP2
> JVM: 1.5.0_04-b05
>
> Thanks,
> Blair Cruz
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070118/fa09661a/attachment.html
More information about the Insight-users
mailing list