Error when using "setBatchMode(true)"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Error when using "setBatchMode(true)"

LIM Soon Yew John (IMB)
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
Reply | Threaded
Open this post in threaded view
|

Re: Error when using "setBatchMode(true)"

Rasband, Wayne (NIH/NIMH) [E]
On Feb 23, 2014, at 10:16 PM, LIM Soon Yew John (IMB) wrote:

> 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.

This 1.48q regression is fixed in the latest daily build (1.48s13).

-wayne

> 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

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Error when using "setBatchMode(true)"

LIM Soon Yew John (IMB)
Dear Wayne,

Thank you, the macro works as normal after updating to the daily build.

Best Regards,
John
________________________________________
From: ImageJ Interest Group [[hidden email]] On Behalf Of Rasband, Wayne (NIH/NIMH) [E] [[hidden email]]
Sent: Tuesday, February 25, 2014 12:32 PM
To: [hidden email]
Subject: Re: Error when using "setBatchMode(true)"

On Feb 23, 2014, at 10:16 PM, LIM Soon Yew John (IMB) wrote:

> 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.

This 1.48q regression is fixed in the latest daily build (1.48s13).

-wayne

> 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

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html