NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 247 - Exception with Macro scripting, command "Stack Combiner"
Exception with Macro scripting, command "Stack Combiner"
Status: RESOLVED FIXED
Product: Fiji
Classification: Unclassified
Component: ImageJ1
unspecified
PC Windows
: P2 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2010-11-16 10:41 CST by Julien Colombelli
Modified: 2010-11-16 16:08 CST
0 users

See Also:


Attachments
A very generic code creating 2 ramp images and trying to combine them, which generates an 'Exception' (238 bytes, application/octet-stream)
2010-11-16 12:07 CST, Julien Colombelli

Description Julien Colombelli 2010-11-16 10:41:48 CST
When trying to recombine two stacks (which are actually two images in this case),
Image J reports the following error, apparently connected to the scripting editor, in an 'Exception' window.

The 'manual' recombination with the pulldown menu works, and the dimensions and formats of the 2 images are compatible. 
latest version 1.44i, Fiji updates done today (16-Nov-2010)


        java.lang.NullPointerException
	at Stack_Combiner.run(Stack_Combiner.java:32)
	at ij.IJ.runUserPlugIn(IJ.java:193)
	at ij.IJ.runPlugIn(IJ.java:154)
	at ij.Executer.runCommand(Executer.java:147)
	at ij.Executer.run(Executer.java:78)
	at ij.IJ.run(IJ.java:269)
	at ij.macro.Functions.doRun(Functions.java:559)
	at ij.macro.Functions.doFunction(Functions.java:79)
	at ij.macro.Interpreter.doStatement(Interpreter.java:201)
	at ij.macro.Interpreter.doStatements(Interpreter.java:189)
	at ij.macro.Interpreter.run(Interpreter.java:100)
	at ij.macro.Interpreter.run(Interpreter.java:72)
	at CLI.Refresh_Macros.runScript(Refresh_Macros.java:54)
	at common.RefreshScripts.runScript(RefreshScripts.java:392)
	at fiji.scripting.TextEditor$13.execute(TextEditor.java:1494)
	at fiji.scripting.TextEditor$Executer$1.run(TextEditor.java:1345)

thanks anyone for some help,
J
Comment 1 Dan White 2010-11-16 11:22:53 CST
Hi Julien,

Can you attach your macro code to this bug report to we can replicate the problem.

Further info, 
recording the stack combiner in the macro recorder giving this command
run("Stack Combiner", "stack=[Combined Stacks] stack=[Combined Stacks-1]");
also give as duplicate commend error. 

cheers, Dan
Comment 2 Julien Colombelli 2010-11-16 12:05:37 CST
Hi, 

As requested I put here an example of code, generated
from the recorder with generic images (ramps),

additional info: before the 'Exception' window opens, 
the 'MyImage' closes, but not 'MyRamp' (the second image to be combined)

I hope someone will be able to reproduce the bug,

thx a lot in advance
Julien

Macro code: 

newImage("MyRamp", "8-bit Ramp", 600, 50, 1);
run("Rotate 90 Degrees Right");
newImage("MyImage", "8-bit Ramp", 600, 200, 1);
run("Flip Horizontally");
run("Rotate 90 Degrees Right");
run("Stack Combiner", "stack=MyImage stack=MyRamp");

 
Comment 3 Julien Colombelli 2010-11-16 12:07:48 CST
Created attachment 30
A very generic code creating 2 ramp images and trying to combine them, which generates an 'Exception'
Comment 4 Johannes Schindelin 2010-11-16 12:12:36 CST
I can reproduce!
Comment 5 Johannes Schindelin 2010-11-16 12:21:45 CST
Fixed in http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=fiji.git;a=commitdiff;h=8ac3243e4210d4b0f923cf1ead1e74bf781fd4b6;hb=refs/heads/master and uploaded.

Note that the last line of the macro must read

run("Stack Combiner", "stack_1=MyImage stack_2=MyRamp");

now (i.e. both "stack" keys need to be replaced).
Comment 6 Wayne Rasband 2010-11-16 15:54:20 CST
The Stack Combiner plugin is built into ImageJ as the Image>Stacks>Tools>Combine command. Here is an updated version of the test macro that uses this command.

    newImage(MyRamp", "8-bit Ramp", 600, 50, 1);
    run("Rotate 90 Degrees Right");
    newImage("MyImage", "8-bit Ramp", 600, 200, 1);
    run("Flip Horizontally");
    run("Rotate 90 Degrees Right");
    run("Combine...", "stack1=MyImage stack2=MyRamp");

-wayne
Comment 7 Julien Colombelli 2010-11-16 16:08:40 CST
Thanks everyone, 
very fast and very helpful,
Best
Julien