// Mean_vs_SD macro by Christophe Leterrier // 02/02/2012 // Perform Photon Transfer Analysis as explained by Nico Stuurman here: http://valelab.ucsf.edu/~MM/MMwiki/index.php/Measuring_camera_specifications // For each condition, take any number of images (2 according to the uManager website, but it can be more) at different exposure levels, and save it as a stack named XXXX.tif where XXXX is the exposure time (in ms padded to 4 digits with zeros) // Point this macro to the folder containing all the acquired XXXX.tif images for this condition // You will have to enter the offset in digital number units (as calculated from a dark stack of images), you can put zero to bypass offset correction // It will output a table containing the image name, exposure time, mean, standard deviation and variance for each stack that you can save as a .txt or .xls. macro "Mean_vs_SD" { InputDir = getDirectory("Please Choose Acquired Stacks Directory"); Files = getFileList(InputDir); Dialog.create("Please Enter Offset Value in Digital Units"); Dialog.addNumber("Offset", 1000, 0, 4, "ADU"); Dialog.show(); Offset = Dialog.getNumber(); run("Set Measurements...", "area mean standard display redirect=None decimal=3"); Expo = newArray(Files.length); Mean = newArray(Files.length); SD = newArray(Files.length); Var = newArray(Files.length); setBatchMode(true); for (i=0; i