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 461 - ImageJ Fiji->Batch Macro Behaviour Differently
ImageJ Fiji->Batch Macro Behaviour Differently
Status: NEW
Product: Fiji
Classification: Unclassified
Component: Other
unspecified
PC Windows
: P2 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2012-08-06 14:11 CDT by maustenfeld
Modified: 2012-08-06 14:11 CDT
0 users

See Also:

Description maustenfeld 2012-08-06 14:11:08 CDT
I have written a small macro for a student which opens a stack, converts it to a Z Project, stores the Z Project image, closes the Z Project image and then processes the stack further. I applied this macro to a folder of images with the Process->Batch->Macro action.

The different behaviour to ImageJ occurs in the macro when the Z Project image is saved and closed. In Fiji a message dialog occurs which complains about the missing image
("There are no images open"). In ImageJ however this macro works.

Here is the script for reproduction which could be applied e.g. to folder of stacks (e.g. a folder with the MRI Example - no image is opened in Fiji, ImageJ):

directory="C:\\"

filename=getInfo("image.filename");
slices=nSlices;//Amount of slices!
run("Z Project...", "start=1 stop="+slices+" projection=[Average Intensity]");
saveAs("Tiff", directory+filename);
close();// Here the possible error occurs!

run("Convolve...", "text1=[-1 -1 -1 -1 -1\n-1 -1 -1 -1 -1\n-1 -1 24 -1 -1\n-1 -1 -1 -1 -1\n-1 -1 -1 -1 -1\n] normalize stack");

setAutoThreshold("Default");
//run("Threshold...");
run("Set Measurements...", "area mean min stack redirect=None decimal=6");
run("Analyze Particles...", "size=0-Infinity circularity=0.00-1.00 show=Nothing clear stack");

saveAs("Results", directory+filename+".xls");
close();

I could reproduce this different behaviour with Fiji and ImageJ on win64 and win32 (on 64-bit maschine).
My OS was Windows 7, Service Pack 1, 8GB RAM, Intel Core i7-2670 QM