Script Parameters using Jython and an IDE

I have a Jython script that have multiple GUI elements built using gui.GenericDialog. I’d like to explore moving to script parameters.

I’m using IntelliJ as my IDE but the script parameters don’t seem to be recognized.

My test script runs fun when using the Fiji Script Editor but the Script Editor isn’t really practical for real world usage.

Is there a way to make ImageJ recognize the script parameters when run via IntelliJ? Should I add additional .jar files to the dependencies in the project structure?

Attached are screen shots of my project settings.

I recommend you have a look at this repository by @haesleinhuepf:

In essence, you need to ensure you’re running your Jython scripts via ImageJ’s ScriptService (as this is the one doing the script parameter preprocessing) by having your IDE run the included Main class:

Hope that helps.