Login  Register

AddSlice to Composite Image causes exception

Posted by Michael Ellis on Feb 12, 2011; 11:08am
URL: http://imagej.273.s1.nabble.com/AddSlice-to-Composite-Image-causes-exception-tp3685705.html

There seems to be a problem when adding an extra slice to a composite image. Problem seems to be easily reproduced with the following macro:

newImage("Untitled", "8-bit White", 400, 400, 3);
run("Make Composite", "display=Composite");
run("Add Slice");

The following exception is thrown:

java.lang.ArrayIndexOutOfBoundsException: 3
        at ij.CompositeImage.updateImage(CompositeImage.java:290)
        at ij.CompositeImage.updateAndDraw(CompositeImage.java:180)
        at ij.ImagePlus.updateAndRepaintWindow(ImagePlus.java:300)
        at ij.ImagePlus.setSlice(ImagePlus.java:1280)
        at ij.plugin.StackEditor.addSlice(StackEditor.java:50)
        at ij.plugin.StackEditor.run(StackEditor.java:24)
        at ij.IJ.runPlugIn(IJ.java:156)
        at ij.Executer.runCommand(Executer.java:124)
        at ij.Executer.run(Executer.java:61)
        at ij.IJ.run(IJ.java:249)
        at ij.IJ.run(IJ.java:227)
        at ij.macro.Functions.doRun(Functions.java:563)
        at ij.macro.Functions.doFunction(Functions.java:79)
        at ij.macro.Interpreter.doStatement(Interpreter.java:203)
        at ij.macro.Interpreter.doStatements(Interpreter.java:191)
        at ij.macro.Interpreter.run(Interpreter.java:102)
        at ij.macro.Interpreter.run(Interpreter.java:72)
        at ij.macro.MacroRunner.run(MacroRunner.java:124)
        at java.lang.Thread.run(Thread.java:680)

The problem is reproducible and appears on both Mac and PC platforms.
Currently testing with imageJ 1.4.5a and Java 6.0


Michael Ellis
Managing Director
Digital Scientific UK Ltd.
http://www.dsuk.biz
[hidden email]