//qFunctions function rgb2Montage(vChoice) { Dialog.create("Montage Choice"); Dialog.addMessage("How many panels?"); Dialog.addMessage("Four Panels (three channels + merge)"); Dialog.addMessage("Three Panels (two channels + merge)"); Dialog.addChoice("I'd like...", newArray("3", "4")); Dialog.show(); panels = Dialog.getChoice(); //Next dialog fourpanel = newArray("RGBM", "RBGM", "GRBM", "GBRM", "BGRM", "BRGM"); threepanel = newArray("RGM", "RBM", "GRM", "GBM", "BRM", "BGM"); grout=8; Dialog.create("Panel Details"); Dialog.addMessage("What layout would you like?"); if (panels=="4") Dialog.addChoice("Four Panels (three channels + merge):", fourpanel); else Dialog.addChoice("Three Panels (two channels + merge):", threepanel); Dialog.addNumber("Grout size (pixels):", 8); Dialog.addNumber("d.p.i.", 300); Dialog.addCheckbox("Scale bar?", false); Dialog.addNumber("Scale bar size (µm):", 10); Dialog.addNumber("1 px is how many µm?", 0.069); Dialog.show(); choice = Dialog.getChoice(); grout = Dialog.getNumber(); res = Dialog.getNumber(); sbchoice = Dialog.getCheckbox(); sblen = Dialog.getNumber(); mag = Dialog.getNumber(); // setBatchMode(true); // dir1 = getDirectory("image"); win = getTitle(); merge = dir1+win; newName = "mtg" + choice + win; getDimensions(w, h, c, nFrames, dummy); // rotate left? if (vChoice == "vert") run("Rotate 90 Degrees Left"); run("Split Channels"); open(merge); // rotate that left too? if (vChoice == "vert") run("Rotate 90 Degrees Left"); run("Images to Stack", "name=stk title=[] use"); len=lengthOf(choice); newImage(newName, "RGB", ((w*len)+(grout*(len-1))), h, 1); //convert choice to numeric (frame number) str1=replace(choice,"R","1"); str2=replace(str1,"G","2"); str3=replace(str2,"B","3"); str4=replace(str3,"M","4"); // for (i=0; i