// Based on code by Michael Schmid: http://imagej.1557.x6.nabble.com/How-to-save-log-files-statistics-using-macro-help-td4999708.html // pjl 3/10/2015 10:41 AM dir = getDirectory("Choose a Directory "); list = getFileList(dir); run("Clear Results"); var bins = 255; var lowZ = 0; var highZ = 65535; Dialog.create("Histogram Range"); Dialog.addNumber("bin size (256 for 8-bit, 255 or 771 or more for 16-bit)", bins); Dialog.addNumber("Starting Intensity", lowZ); Dialog.addNumber("Ending Intensity", highZ); Dialog.show(); bins = Dialog.getNumber(); lowZ = Dialog.getNumber(); highZ = Dialog.getNumber(); setBatchMode(true); row = 0; for (i=0; i