//This macros takes a folder with stacked tiff files with DAPI first, then FITC //It has an auto-defined threshold value for DAPI, then uses the //DAPI mask to define ROIs for the FITC channel. The Find Maxima algorithm is used //to find "Foci" and the results are binary, where one focus is 255 a.u. //Prior to running the script, user must already know the threshold values to identify //foci. When thresholding, the nuclei should be red and the background dark. //Updated August 26, 2021 by bcm //J. Bagnall inputFolder = getDirectory("Choose input folder"); var allImages; allImages = getFileList(inputFolder); numberOfImages = allImages.length; if (getVersion>="1.40e") setOption("display labels", true); setBatchMode(true); //path = File.openDialog("Select a File"); //dir = File.getParent(path); //filename = File.getName(path); //print("Path:", path); //print("Name:", filename); //print("Directory:", dir); resultfilename = getString("Enter result file name: ", resultfilename); //Get threshold from user Dialog.create("Choose FITC Threshold Values"); Dialog.addNumber("Low threshold:", 20); Dialog.addNumber("High threshold:", 65535); Dialog.show(); lowThreshold = Dialog.getNumber(); highThreshold = Dialog.getNumber(); for (i=0; i