macro "CIJA Action Tool - C059T3e16C" //converts image to 8 bit, sets the image scale based on the magnification specified in filename, //auto thresholds, inverts image, analyzes particles, and prints data to an excel file { run("8-bit"); name = getInfo("image.filename"); if (substring(name,9,10) == "1") //assumes filename is of format DSC_####-*.JPG with * being the magnification { run("Set Scale...", "distance=6000 known=23500 unit=um"); } else if (substring(name,9,10) == "2") { run("Set Scale...", "distance=6000 known=47000 unit=um"); } else if (substring(name,9,10) == "3") { run("Set Scale...", "distance=6000 known=70500 unit=um"); } else if (substring(name,9,10) == "4") { run("Set Scale...", "distance=6000 known=94000 unit=um"); } else if (substring(name,9,10) == "5") { run("Set Scale...", "distance=6000 known=117500 unit=um"); } run("adaptiveThr ", "using=Mean from=70 then=-50"); run("Invert"); run("Analyze Particles...", "display exclude summarize"); run("Read and Write Excel", "sheet=Results file=[C:/Users/jjlydon/Desktop/FC-ImageJ/ImageJ/ImageJ_Report.xlsx]"); }