//Created by Lim Soon Yew John on 6 Aug 2011 //To montage multi-channels images with overlay //Version 1: 8 Aug 2011, Montage up to first 3 channels Stack.getDimensions(width, height, channels, t_slices, t_frames); if(channels==1) { exit("There is only one channel."); } id0=getImageID(); Stack.getPosition(channel, slice, frame); ave=(width+height)/2; mb=round(ave*0.0058); if(mb<1){mb=1;} setBatchMode(true); if(channels==2) { run("Duplicate...", "title=CompositE duplicate channels=1-2 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-2 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+Composite]"); run("Make Montage...", "columns=3 rows=1 scale=1 first=1 last=3 increment=1 border=mb font=12 use"); setBatchMode("exit and display"); } if(channels>=3) { 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"); }