I have a macro in Fiji that shading corrects images, processes these, and performs other steps to count cells in stacks and output results as a.csv file. It is set up to work through the wells of a 96-well plate. I call setBatchMode(true) ;
at the beginning and
at the end.
In this macro, two Results windows are maintained. The first is created when Analyze Particles is called and the second is used to hold the tabulated results from each well. I use IJ.renameResults to maintain the contents of the results windows correctly.
The issue I am having is that, because Results windows are displayed, even in batch mode, the Results window grabs focus repeatedly while the macro runs, so that any key strokes I input into another application (like Chrome, or whatever) are trapped and applied to the Results window, often generating an error message in the macro.
This means that I cannot get any other work done on my computer while my macro runs.
This problem seems to cry out for running the macro in headless mode, which I have never done.
Instead of getting input from the user, I need to pass the following parameters in the command line: 1) the fully qualified name of a shading image; 2) the directory where the input files are; 3) the single letter string corresponding to the row of the 96 well plate that contains the control cells.
I have looked at the documentation for running a macro in headless mode, but can’t figure out a) how to pass parameters; b) how to link the parameters passed in the command line to the correct variables in the macro.
For example, instead of:
FlatFieldPath= File.openDialog(“Select the flat field image”);
flatfield = getTitle ;
How do I assign the fully qualified name of the flat field image that has been supplied in the command line to FlatFieldPath?
Many thanks to all for any help.