[Insight-users] ImageJ and ITK on Solaris

Michael Bell michael.bell at acm.org
Mon Jun 12 09:40:59 EDT 2006


All,

I am trying to use itk within ImageJ on Solaris. The following
smoothing code works fine in ImageJ on Linux, and fine on solaris in a
stand alone java program, but I get an exception when using ImageJ:

42 itkImageFileReaderF2_Pointer reader =
43         itkImageFileReaderF2.itkImageFileReaderF2_New();
44 reader.SetFileName( "line3.png");
45 itkSmoothingRecursiveGaussianImageFilterF2F2_Pointer filter =
46         itkSmoothingRecursiveGaussianImageFilterF2F2.
                 itkSmoothingRecursiveGaussianImageFilterF2F2_New();
47 filter.SetInput(reader.GetOutput());
48 filter.Update();  //exception occurs here

Here is the exception:
java.lang.RuntimeException:
/stuff/InsightToolkit-2.6.0/Code/Common/itkImageBase.txx:249:
itk::ERROR: Image(0x1a0b28): itk::ImageBase::CopyInformation() cannot
cast PKN3itk10DataObjectE to PKN3itk9ImageBaseILj2EEE
 at InsightToolkit.itkSmoothingRecursiveGaussianImageFilterJNI.itkSmoothingRecursiveGaussianImageFilterF2F2_Pointer_Update(Native
Method)
 at InsightToolkit.itkSmoothingRecursiveGaussianImageFilterF2F2_Pointer.Update(itkSmoothingRecursiveGaussianImageFilterF2F2_Pointer.java:245)
 at itktest_.run(itktest_.java:48)
 at ij.IJ.runFilterPlugIn(IJ.java:197)
 at ij.IJ.runUserPlugIn(IJ.java:275)
 at ij.IJ.runPlugIn(IJ.java:117)
 at ij.Executer.runPlugIn(Executer.java:171)
 at ij.Executer.runCommand(Executer.java:133)
 at ij.Executer.run(Executer.java:63)
 at java.lang.Thread.run(Thread.java:534)

I am using java 1.4.2_11 for the java wrapping and for ImageJ. ITK is
version 2.6. I have seen this error on the Insight-users list before,
but I have not seen it resolved. I did a complete compile of ITK
before running this code.

Any help is greatly appreciated.

thanks,
michael

-- 
michael.bell at acm.org


More information about the Insight-users mailing list