// Michael Cammer 20120312 // Macro to split grayscale image and merge. // Works on stacks. macro "Split and Merge" { right = getTitle; width = getWidth; height = getHeight; if ((width/2) != floor(width/2)) exit("Image not even # pixels wide."); makeRectangle(0, 0, width/2, height); slices = nSlices; run("Duplicate...", "title=LEFT duplicate range=1-"+slices); left = getTitle; selectWindow(right); makeRectangle(width/2, 0, width/2, height); run("Crop"); run("Merge Channels...", "c1=LEFT c2="+right); rename("merged_"+right); } // end