I am exploring the reuse of script with parameter annotation and I was wondering what was the best way to catch the output. Here is a dummy script (dummy.py)
# @String name1 # @String name2 # @OUTPUT String greeting1 # @OUTPUT String greeting2 greeting1 = "Hello, " + name1 + "!" greeting2 = "Hello, " + name2 + "!"
After copying the script to my Fiji plugins directory I can call it from another script with
I was wondering if there was an equally simple way to call the script and collect output programatically. following the IJ Tutorial execute-commands I managed to collect the output with the following strategy:
- based on script name discover the script path
- use a scriptService to run the script and collect the outputs
Is that the way to go ?
Also I had the following issues during my trial :
- from Jython I did not manage to use the interface scriptservice.run(scriptPath, Process, InputMap) (it worked fine in Java). For some reason the content of my InputMap was not recognised independant whether I use a Jython dictionnary or instanciate a Hashmap (I could provide some code to illustrate that). I started playing with module but things were gettting a bit too complicated for me. Any clues?
- How can I inform the script that output don’t need to pop up in the UI? Setting Process parameter to False will disable postProcessor Plugins but then I also loose preprocessors (and harvesting of missing parameters).
Thanks for your help and comments.