macro ".czi 96 wells to stack & montage" { contrastEnhance = getBoolean("Do you want to linearly enhance contrast of each well?"); imagePath = getDirectory("image"); title = replace(getTitle(), ".czi", ""); title = substring(title, 0, (lengthOf(title)/2)-2); // because LOCI doubles the title run("Concatenate...", "all_open title=Concat"); getDimensions(width, height, channels, slices, frames); if (channels==2) { Stack.setDisplayMode("composite"); Stack.setChannel(1); run("Green"); Stack.setChannel(2); run("Grays"); } saveName = imagePath + title + "_original"; saveAs("Tiff", saveName); if (contrastEnhance ==1) { for (s=1; s<=nSlices(); s++) run("Enhance Contrast...", "saturated=0 normalize"); } run("Channels Tool..."); run("Brightness/Contrast..."); waitForUser("In Brightness/Contrast window, adjust each channel and click ok."); run("RGB Color", "frames"); saveName = imagePath + title + "_RGB"; saveAs("Tiff", saveName); //if ((frames == 96) || (slices == 96)) { run("Make Montage...", "columns=12 rows=8 scale=1 first=1 last="+nSlices()+" increment=1 border=0 font=12"); saveName = imagePath + title + "_montage"; saveAs("Tiff", saveName); //} // if montaging }