[Insight-users] ImageJ and ITK on Solaris

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Mon Jun 12 10:00:06 EDT 2006


On Mon, 12 Jun 2006 15:40:59 +0200, Michael Bell <michael.bell at acm.org>  
wrote:

> 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.
>

Can you give a pointer to the mail describing this problem ?

It looks a lot like the problem we had some time ago with python: objects  
can't be transfered to one .so module to another .so module. Just to be  
sure, can you replace your SmoothingRecursiveGaussianImageFilter by a  
ImageFileWriter ?

Gaetan


-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr


More information about the Insight-users mailing list