Running an ImageJ Macro in headless mode



I have a large Macro that I would like to put under Continuous Integration. I’d like to have it process a number of files in an automated fashion and compare the results against expected results. The Macro however utilises a bunch of Dialogs to get the settings that are needed for running it. I’ve found that it is possible to run ImageJ in headless mode. When running the macro in Headless mode however, I cannot find a way to make choices in the dialogs.

Can anyone help? I’d like to know how to provide the dialogs with information while running from command line.

Thanks in advance!


If you run your macro interactively (after having placed the .ijm file – that needs to contain an underscore in the file name – somewhere in a subdirectory of ./ while running the macro recorder, it will record the necessary commands to call your macro without the dialogs (from another macro or headless from the command line).


Cool, thanks! I also found out manually that it is quite possible to call macro’s and plugins by providing them with user input by specifying things like:

run('Concatenate...', ' title=[maxProjectStack] image1=maxProjectStack image2=[Result of subtractTemp] image3=[-- None --]');

Your way to figure things out is a lot more helpful though!