FIJI macro execution in OMERO in parallel

I like the FIJI-OMERO bridge that allows getting the images to FIJI and processing them and uploading them back to OMERO, but I am wondering if there is a way to develop a script for OMERO similar to batch macro execution in FIJI but parallel such that the end users pick the images/datasets/projects and don’t need to worry about looping over the images or initializing sessions getting the images and uploading them back to the server.

For my end users downloading and uploading the images for processing in FIJI is relatively slow compare to 40G network connection between omero server and storage. So we can gain a lot by doing the processing on the server.

Hi,

We are aware of users running ImageJ on the server for image processing via OMERO.scripts in python. It is possible to use python to call an ImageJ macro via the command line. For example, Alex Herbert at the University of Sussex has several scripts E.g.

http://www.sussex.ac.uk/gdsc/intranet/microscopy/Datamanagement/omero/scripts/correlation

Script is at https://github.com/aherbert/omero-user-scripts/blob/master/Correlation_Analyser.py

However, in our own testing we have run into issues when multiple ImageJ instances are used in parallel by one or many users. If you try it out, please let us know how it works for you.
Regards,
Will.

Thanks for pointing to the script. Is there a way to have a text box with a given number of rows and cols for the user to copy and paste their macro text?
I tried to use multi-line strings, but GUI only shows a single line.

“”“This is the first line.
This is the second line.
This is the third line.”""
or
“This is the first line.\n”
“This is the second line.\n”
“This is the third line.”

What kind of issues are expected when running multiple ImageJ instances?

Hi,
I’m afraid there’s no way currently to have a Text Box in the script GUI and it seems that the line breaks are lost if you use a regular String input.
Other options for sending multi-line text to a script is to attach a text file to E.g. Project or Dataset, such as for ‘populate_metadata’ script (see http://help.openmicroscopy.org/scripts.html#metadata) or you could simply edit the Description of the Image you want to process and paste the text there, which can be read by the script. It’s not ideal but it might work for you.

I’m wondering whether allowing users to enter arbitrary macros is a good idea? For the examples at http://www.sussex.ac.uk/gdsc/intranet/microscopy/Datamanagement/omero/scripts/ and in our own limit testing, we prepare a single script with a single macro. This is because the macro is quite tightly coupled to the input and output from ImageJ, and you need the python code to load suitable data from OMERO and to handle the output of the IJ Macro, saving it back to OMERO in some way. E.g. the output might be 1 or more images, or csv file or ROIs etc.

But perhaps you could parse the Macro text from users to check whether it calls a ‘whitelist’ of macros that produce output that the script can handle?

Just to clarify - our testing was with multiple users simultaneously running macros on a single ImageJ. Unfortunately this was a while ago and one of the main team members who did the work is currently on vacation, so it’s difficult to provided details of what failed. We considered installing multiple copies of ImageJ under different locations and have each user call a different one, but this seemed too much work and not scalable.
It’s possible that the python script could copy the ImageJ app itself into the script directory where the python code it running before executing the Macro there (the directory is cleaned up by the server when the script completes) but we haven’t tried that.
It would be interesting to hear if Alex Herbert had any problems and how he resolved them but it seems he is no longer at Sussex uni.

Will.