/* Macros for ImageJ 1.51t by Michael Cammer mcammer@gmail.com http://microscopynotes.com/ If you use these macros, please acknowledge the DART Microscopy Core Laboratory at NYU Health. v100 20171214 */ macro "Color using max" { original = getImageID; t = getTitle; run("Z Project...", "stop=6 projection=[Max Intensity]"); rename("b"); run("Enhance Contrast...", "saturated=0 normalize"); selectImage(original); run("Z Project...", "start=8 stop=11 projection=[Max Intensity]"); run("Enhance Contrast...", "saturated=0 normalize"); rename("g"); selectImage(original); run("Z Project...", "start=13 projection=[Max Intensity]"); run("Enhance Contrast...", "saturated=0 normalize"); rename("r"); run("Merge Channels...", "c1=r c2=g c3=b create"); rename("maxmerged_" + t); } macro "Color using avg" { original = getImageID; t = getTitle; run("Z Project...", "stop=6 projection=[Average Intensity]"); rename("b"); // run("Enhance Contrast...", "saturated=0 normalize"); selectImage(original); run("Z Project...", "start=8 stop=11 projection=[Average Intensity]"); // run("Enhance Contrast...", "saturated=0 normalize"); rename("g"); selectImage(original); run("Z Project...", "start=13 projection=[Average Intensity]"); // run("Enhance Contrast...", "saturated=0 normalize"); rename("r"); run("Merge Channels...", "c1=r c2=g c3=b create"); rename("avgmerged_" + t); run("RGB Color"); run("Scale Bar...", "width=10 height=5 font=18 color=Gray background=None location=[Lower Left] bold"); } macro "simple graph intrensity by wavelength range" { run("Hyperstack to Stack"); run("Plot Z-axis Profile"); } macro "extract two channels and remerge" { original = getImageID; t = getTitle; b = "blue"+t; r = "red" + t; run("Duplicate...", "title=["+b+"] duplicate channels=10"); selectImage(original); run("Duplicate...", "title=["+r+"] duplicate channels=20"); run("Merge Channels...", "c1=[" + r + "] c3=["+b+"] create"); rename("ch10and20_"+t); } macro "extract two channels and remerge MC" { original = getImageID; t = getTitle; b = "blue"+t; r = "red" + t; run("Duplicate...", "title=["+b+"] duplicate channels=10"); selectImage(original); run("Duplicate...", "title=["+r+"] duplicate channels=20"); run("Merge Channels...", "c7=[" + r + "] c5=["+b+"] create"); rename("ch10and20_"+t); } macro "Plot spectrum" { t = getTitle; start = 415; // approx average of 409.92320200000012-418.82141700000017 step = 9; // nm run("Hyperstack to Stack"); slices = nSlices; run("Set Measurements...", "mean redirect=None decimal=3"); run("Clear Results"); for(s=1; s<=slices; s++) { setSlice(s); run("Measure"); } nmlabels = newArray(nResults); intensities = newArray(nResults); for (i=0; i