//Side-by-side movie, Norbert Vischer, 02-oct-2013 //Splits a hyperstack movie so that channels appear side-by-side //For scaling-down, change 'factor = 1;' to different value //Optionally saves as .avi // https://sils.fnwi.uva.nl/bcb/objectj/examples/utils/ macro "Make 3-ch stack for demo [F1]"{ newImage("HyperStack", "8-bit color-mode label", 300, 300, 3, 1, 33); } macro "Mitosis 2-ch for demo [F2]"{ run("Mitosis (26MB, 5D stack)"); Stack.setSlice(4); Stack.setDisplayMode("color"); run("Reduce Dimensionality...", "channels frames keep"); } macro "Side-by-side movie [F3]"{ factor = 1; getDimensions(width, height, channels, slices, frames); if (channels == 1) exit("channels =1"); if (isOpen("Combined")) showMessageWithCancel("Close existing window'Combined'?"); close("Combined"); if (factor != 1) run("Scale...", "x=&factor y=&factor create title=Tmp"); srcID = getImageID; close("Ch_*"); for (ch = 1; ch <= channels; ch++){ selectImage(srcID); run("Duplicate...", "title=tmp duplicate channels=&ch"); run("RGB Color"); title = "Ch_" + ch; rename(title); if (ch > 1){ run("Combine...", "stack1=Combined stack2=" + title); } rename("Combined"); close(title); } showMessageWithCancel("Save as .AVI?"); run("AVI... ", "compression=JPEG frame=15"); }