Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fiji/ImagJ command line argument input and return?

I am wondering if I am running Fiji under --headless mode, what is the best way to pass the parameters to some macros? And what is the best way to return some message (ex. macro execute is done, or some error message)

For example, I have a macro that performs FFT for every single one image in a folder, then spitting out the results to another folder. If I'd like to type the input folder and the output folder as arguments in the command line that launch the macro. I would also like to know when the macro is done executing.

I read ImageJ running using command line, and it mentioned -macropath[arg] parameter, but without example, it is not clear to me what it can do, and whether it is what I am looking for.

Any pointer is appreciated. Thanks.

like image 538
Nick X Tsui Avatar asked Feb 22 '26 20:02

Nick X Tsui


1 Answers

According to the example the last arg (/Users/wayne/images/stack1) will be available as a string within the macro and can be access via a call to the getArgument() function.

-macro analyze /Users/wayne/images/stack1

For completion output, try just using the print() function. I think this will get output to the console that you running the macro from.

print("My macro is finished!");
like image 195
steakchaser Avatar answered Feb 27 '26 01:02

steakchaser



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!