Login  Register

Problem with PlugIn

Posted by Sebastian Rhode-2 on Apr 23, 2008; 2:29pm
URL: http://imagej.273.s1.nabble.com/Problem-with-PlugIn-tp3696466.html

Hi all,

I am pretty new to Java and may need your help (so my problem may be a
simple one). Here is part of the code

...
ImagePlus imp_dst = WindowManager.getImage(wList[file0]);
ImageStack imst_dst = imp_dst.getStack();
double[] pixels;
...
// get the pixels of each slice in the stack
for (int i=1; i<=imst_dst.getSize(); i++) {
   pixels = (double[]) imst_dst.getPixels(i);
...

The PlugIn compiles without any Problem. The stack which is open contains
four 16bit pictures (512x512). I get the follwong error meassage:

     java.lang.ClassCastException: [S cannot be cast to [D
    at calcCCD_noise3.run(calcCCD_noise3.java:73)
    at ij.IJ.runUserPlugIn(IJ.java:158)
    at ij.ImageJ.runUserPlugIn(ImageJ.java:232)
    at ij.plugin.PlugInExecuter.run(Compiler.java:239)
    at java.lang.Thread.run(Unknown Source)

I am using ImageJ 1.40g and Java 1.6.0_04. Any ideas?

Thanks,

Sebastian