// Batch script which processes raw images of cell microarrays. Input images should be 32-bit RGB TIFF files. // This script will convert the raw images to 8-bit TIFF files and optionally rotates them 90 degrees // clockwise so they're upright, i.e., first arrayed condition at the top left. // Images are additionally binned to enable quantification by CellProfiler. // The script will write the selected settings into a file titled "settings.txt" in the destination folder. // Initial options setBatchMode(true) // Create the dialog box to select the desired settings Dialog.create("Array processing"); Dialog.addNumber("Binning in x:", 4); Dialog.addNumber("Binning in y:", 4); Dialog.addCheckbox("Rotate 90 degrees clockwise", true); Dialog.addCheckbox("Enhance contrast", false); Dialog.addNumber("% pixels saturated", 0.4); Dialog.show(); // Capture values from dialog xBinning = Dialog.getNumber(); yBinning = Dialog.getNumber(); rotate = Dialog.getCheckbox(); enhance = Dialog.getCheckbox(); pixelSaturated = Dialog.getNumber(); // Get source and destination directories source = getDirectory("Choose Source Directory"); sourceList = getFileList(source); destination = getDirectory("Choose Destination Directory"); // Perform desired operations for (i=0; i