Login  Register

Error when using "setBatchMode(true)"

Posted by LIM Soon Yew John (IMB) on Feb 24, 2014; 3:16am
URL: http://imagej.273.s1.nabble.com/Error-when-using-setBatchMode-true-tp5006643.html

Dear All,

I encounter a problem with a macro I wrote below to create RGB montage of different channels and its composite after I updated Fiji to 1.48r (32-bit). I had traced the problem to "setBatchMode(true)". When setBatchMode is set to true, run("Concatenate...", "stack1=[Ch (RGB)] stack2=[CompositE (RGB)] title=[(RGB) Ch1+Ch2+Ch3+Composite]") failed to work as it was unable to find those images.

run("Fluorescent Cells (400K)");
setBatchMode(true); //If disable, this macro works
id0=getImageID();
Stack.getDimensions(width, height, channels, t_slices, t_frames);
Stack.getPosition(channel, slice, frame);
ave=(width+height)/2;
mb=round(ave*0.0058);
if(mb<1){mb=1;}
run("Duplicate...", "title=CompositE duplicate channels=1-3 slices=slice frames=frame");
Stack.setDisplayMode("composite");
id1=getImageID();
run("RGB Color");
selectImage(id1);run("Close");
selectImage(id0);
run("Duplicate...", "title=Ch duplicate channels=1-3 slices=slice frames=frame");
Stack.setDisplayMode("color");
id2=getImageID();
run("RGB Color");
selectImage(id2);run("Close");
run("Concatenate...", "stack1=[Ch (RGB)] stack2=[CompositE (RGB)] title=[(RGB) Ch1+Ch2+Ch3+Composite]");
run("Make Montage...", "columns=2 rows=2 scale=1 first=1 last=4 increment=1 border=mb font=12 use");
setBatchMode("exit and display");

Best Regards,
John
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html