Expanding jython scripting with the java api on the wiki



I am very comfortable with Python but have little experience with Java and so jython scripting in ImageJ was always a painful process of stackoverflow/forum searching and blind copy pasting until something worked (you can tell from some of my past questions on this forum). I gave up for a while but in the interim I learned a lot and when I came back to this recently I saw the light (read the docs and thought about what I was doing) and now understand how to troubleshoot and write my own scripts with python and the Java-ImageJ API.
I know there was a proposal some time ago to update the jython scripting page (Rewriting the Jython Scripting wiki page) and while the new page looks great, I think the working with Java modules could use a little work. http://imagej.net/Jython_Scripting#Importing_Java_module_and_classes
I wrote this example based problem solving guide https://github.com/Macklin-Lab/imagej-microscopy-scripts/blob/master/scripting-with-java-classes.org the other night and something like that would have been extremely helpful to my past self.
My question is whether anyone thinks that a heavily condensed and edited version of something like this would be useful to add to the wiki page under “Importing Java modules and classes”?
Happy to put it together if it is worth it-- but I know my past self would have loved something like this.


Hey @Nick_George
This is awesome. I’m comfortable with Python and the default IJ1 Macro language, but have no experience with Java. Its been a bit daunting whenever I tried looking into Java, but your guide is immensely useful and has really gotten me interested to learn more. The ImageJ documentation for Java packages and classes make so much more sense. Really appreciate it and would love to see similar guides.




Thanks @pr4deepr! I will make this a bit more condensed and targeted and look into putting in a PR for the main docs


@imagejan I’m interested in your feedback here-- as in whether you think it would be worth adding something like this to the website docs. I saw your nice explanation (I wish I’d stumbled on it sooner) of working with Java classes from a scripting language here Plug-in for importing Image Sequence


Super helpful, thanks @Nick_George!