// This macro was designed to count nuclei per cluster. // It will prompt you to select a directory and analyze all files it finds there // that end in "b.jpg" (incl subfolders). See line 52 to modify the filename // filter for your own uses. // // PS: For each file it should produce a .csv with results, a .zip file with ROI // data, and a .txt with the log data. // // This script goes heavy on the logging. However, the threshold values are logged, // too, so you can go back and see what they were. Useful, I hope. // // -JSW, last updated 6 Apr 2016 requires("1.47g"); dir = getDirectory("Choose a Directory: "); setBatchMode(false); count = 0; countFiles(dir); n = 0; processFiles(dir); //print(count+" files processed"); run("Input/Output...", "file=.csv"); print("\\Clear"); //this empties the log function countFiles(dir) { list = getFileList(dir); for (i=0; i