We're Hiring!

Write omero script in Java

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Write omero script in Java

Postby yossioulu » Sun Jan 17, 2016 3:04 pm

Hi,
Is it possible to write an Omero script in Java only without using python?
It seems that it is all there but how to I show the UI of the script input like what exist in Python.

I'm trying to avoid the need to call java from python. (py4j needs a separate agent to be running. I don't like it since it creates another point of failure if this server does not run for some reason, or if you run it twice, and I did not manage to utilize the other python to Java components)

Thanks
Joe
yossioulu
 
Posts: 6
Joined: Thu Dec 03, 2015 6:59 pm

Re: Write omero script in Java

Postby jmoore » Mon Jan 18, 2016 10:53 am

Hi Joe,

yossioulu wrote:Is it possible to write an Omero script in Java only without using python?
It seems that it is all there but how to I show the UI of the script input like what exist in Python.


Currently, Java isn't one of the 3 script file types configured by default: Python, Jython, and Matlab. (See blitz-servantDefinitions.xml)

The primary problem with using Java is that it's a compiled language, so there would be some question of how you'd store the code to be executed in OMERO. Each of the scripts is currently downloaded on demand.

I'm trying to avoid the need to call java from python. (py4j needs a separate agent to be running. I don't like it since it creates another point of failure if this server does not run for some reason, or if you run it twice, and I did not manage to utilize the other python to Java components)


Understood, but I think there are a few options:

  • Use Python to execute a Java application installed elsewhere. If you know that `java -jar /opt/my-code/foo.jar` is what you need, there's no reason that that can't be invoked by a small Python wrapper.
  • Use Jython (or similar scripting language) to invoke your Java code.
  • Try using the imagej-omero wrapper.
  • Register another script file type to match your needs.

Perhaps you could tell us a bit more about the Java code you want to invoke?

Cheers,
~Josh.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany


Return to Developer Discussion

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron