Open xp1632 opened 5 months ago
Running ImageJ from the command line typically starts a new instance of ImageJ each time, which is separate from any existing instances.
If we want to run commands in an existing ImageJ instance, we would need to use some form of inter-process communication (IPC) to send commands to that instance.
pyImageJ
Marco file
This command runs ImageJ in headless mode (without a GUI), opens the console for input and output, and runs a macro from a file. Replace
path_to_your_macro.ijm
with the path to your ImageJ macro file.Please note that this requires ImageJ to be installed on your system and the
ImageJ
command to be available in your system's PATH.Sole function, the ones that supports headless mode are supported
If you want to call ImageJ functions directly from the command line without using a macro, you can use the
--run
option followed by the name of the function and its arguments. Here's an example:Replace
YourFunction
with the name of the ImageJ function you want to run, andarg1 arg2
with the arguments to the function.Please note that not all ImageJ functions may be available or work correctly from the command line, especially those that require a GUI.