[ome-devel] HPC/OMERO integration
Josh Moore
josh at glencoesoftware.com
Wed Feb 29 12:21:36 GMT 2012
Melissa, a few issues with headless exception of bioformats on the cluster which Alex recently brought up in a private message based on the forum post: https://www.openmicroscopy.org/community/viewtopic.php?f=6&t=1051#p3834
Also, if anyone else is doing something similar with their cluster and OMERO, let us know.
~Josh.
> Sent: Tue Feb 21, 2012 1:37 pm
> by a.herbert
>
> Hi Josh,
>
> I can send you my code so you can have a look at it.
Done. Thanks!
> Basically I have an OMERO script that checks parameters and then calls a command-line script to do the work. This means I can test and develop the script without going through the OMERO scripts interface.
>
> First I export the image as single plane tiffs. The only way I have managed to get it to work for my 16-bit multi-plane images is to convert them using numpy to 32-bit floats. These can be IO handled by PIL. PIL is not as advanced at reading and writing TIFFs as it could be.
>
> The rest of the processing is done by submitting a bunch of jobs to a farm. The final script collates all the output images and uploads them using the Python API. This creates a new image using a numpy array generator that reads the TIFFs.
>
> It is a bit of a mishmash but I got it to work. The reusable parts would probably be the process for getting the images out of OMERO and back in. The rest of the code is custom.
>
> I have used a similar approach to call ImageJ within OMERO scripts. I had to overcome the Java headless problem (since my server does not have an X environment and Java's AWT libraries on linux are tied to the X server). This was easy enough for ImageJ with a few custom classes that do not show graphical objects. I can then call ImageJ with a script to do any processing I like on the exported TIFFs.
>
> I could not use BioFormats in a headless environment. It has code tied to the X lib too. So instead of trying to recode this I just export my images to TIFFs and ImageJ can read them.
See below for a follow-up on this.
...
> Alex
> Sent: Tue Feb 28, 2012 4:41 pm
> by a.herbert
>
> I just checked the problem with BioFormats again. The issue is that to run in a headless environement you have to alter the GenericDialog so that it does not extend java.awt.Dialog. The java.awt.Dialog class throws a HeadlessException when GraphicsEnvironment.isHeadless() returns true.
>
> Changing the signature causes BioFormats to error since the GenericDialog does not match the signature it is expecting:
>
> Code: Select all
> java.lang.VerifyError: (class: loci/plugins/in/MainDialog, method: rebuildDialog signature: (Lij/gui/GenericDialog;)V) Incompatible argument to function
> at loci.plugins.in.ImporterPrompter.promptMain(ImporterPrompter.java:126)
> at loci.plugins.in.ImporterPrompter.statusUpdated(ImporterPrompter.java:79)
> at loci.plugins.in.ImportProcess.notifyListeners(ImportProcess.java:461)
> at loci.plugins.in.ImportProcess.step(ImportProcess.java:757)
> at loci.plugins.in.ImportProcess.execute(ImportProcess.java:142)
> at loci.plugins.in.Importer.showDialogs(Importer.java:125)
> at loci.plugins.in.Importer.run(Importer.java:77)
> at loci.plugins.LociImporter.run(LociImporter.java:79)
> at ij.IJ.runUserPlugIn(IJ.java:183)
> at ij.IJ.runPlugIn(IJ.java:150)
> at ij.Executer.runCommand(Executer.java:127)
> at ij.Executer.run(Executer.java:64)
> at ij.IJ.run(IJ.java:249)
> at ij.macro.Functions.doRun(Functions.java:579)
> at ij.macro.Functions.doFunction(Functions.java:82)
> at ij.macro.Interpreter.doStatement(Interpreter.java:203)
> at ij.macro.Interpreter.doStatements(Interpreter.java:191)
> at ij.macro.Interpreter.run(Interpreter.java:102)
> at ij.macro.Interpreter.run(Interpreter.java:72)
> at ij.macro.Interpreter.run(Interpreter.java:83)
> at ij.plugin.Macro_Runner.runMacro(Macro_Runner.java:102)
> at ij.plugin.Macro_Runner.runMacroFile(Macro_Runner.java:87)
> at ij.IJ.runMacroFile(IJ.java:117)
> at ij.ImageJ.main(ImageJ.java:610)
>
>
> Maybe I have not got my headless modifications correct. There may be a way around this I have not tried.
>
> Alternatively it may be that I should just recompile BioFormats against my headless.jar. Then the Java linking should be OK.
>
> I'll package up my cluster scripts and send them to you.
>
> Alex
More information about the ome-devel
mailing list