
so we can add the filename just to the new results Store the number of results before executing the commands, OutputFile = File.openDialog("Save results file") Show a dialog to allow user to save the results file
IMAGEJ COLOR THRESHOLD UPDATE
UpdateResults() // Update the results table so it shows the filenames ****NOTE: if there are non-image files in this directory, it may cause the macro to crash**** Get the list of files from that directory Input_dir = getDirectory("select process folder") Output_dir = home_dir + "output" + parator // prepare a folder to output the images Home_dir = getDirectory("select home folder") ask user to select a folder (should be parent folder) This is my first time writing a script in ImageJ macro, and I don't know what else to try! Any ImageJ Macro wizards out there who can spot my problem? Gratitude in advance for many tedious hours of repetitive clicking avoided. My other guess is that my process for generating the filenames is failing, but I've gone through a troubleshooting process to print the generated names, and this suggests that the names are being generated correctly. I've also tried modifying the output directory - I wonder whether the issue results from some issue with which directory the images are being saved to. With this modification, the output file is not saved even when the images are thresholded manually. tif file outside the if/else statement, but still inside the processImage function. In troubleshooting this issue, I've tried saving the. tif files are not saved when the thresholding is done automatically (interestingly, the files are saved when the else portion of the script is run, i.e. The majority of the script works, but the. To make this possible, I duplicate the imagefile at the beginning of the script, and revert to the original in order to process it manually. If yes, then the particles are analyzed, and if no then the color threshold is re-set to be done manually. The most important of these follows an if/else statement in which user input determines whether the automatic color thresholding is acceptable.

Most of the time the thresholding works automatically, but sometimes has to be done manually, so I've created a partly automated "human-in-the-loop" script, which pauses for user input in several places. I've written a script in ImageJ Macro in order to batch process a large number of images with color thresholding and particle analysis, modified from this tutorial.
