We're Hiring!

Running ImageJ plugin in batch through uploaded scripts

General user discussion about using the OMERO platform to its fullest. Please ask 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

There are workflow guides for various OMERO functions on our help site - http://help.openmicroscopy.org

You should find answers to any basic questions about using the clients there.

Running ImageJ plugin in batch through uploaded scripts

Postby tom_deschamps » Fri Mar 22, 2013 12:45 am

Hi

I am new to OMERO and would like to know if it is possible to do the following :
I have an ImageJ plugin installed on the same machine than the OMERO server I would like to run in batches over a set of selected images as they are pushed to the server.
I would also like to upload new scripts (which call that plugin on the server), and monitor the results from the client insight.
So my questions are:
- can we launch an imageJ plugin from a python script running on the server?
- can we do that in batch processing on multiple images, storing the results on the server?
Thanks
tom_deschamps
 
Posts: 22
Joined: Fri Mar 22, 2013 12:22 am

Re: Running ImageJ plugin in batch through uploaded scripts

Postby wmoore » Fri Mar 22, 2013 10:05 pm

We are discussing how to do a 'proper' job of integrating ImageJ2 plugins with OMERO, running "headless" on the server. However, this won't be available to you just yet, so one approach you can try is to set up ImageJ so that you can call your plugin on the command line from Python.

I have used this a couple of times as a proof of principle, both from within a Python script on the server and (more experimentally) from the web framework: see https://github.com/will-moore/weblabs/b ... ews.py#L74

You don't have to worry about creating and removing a temp directory in the scripting service, since the server sets that up for you (your script is copied to a temp folder before being run).

How you handle the result depends on what it is. If it's a file, you can attach it to an image. If it's a bunch of tiff files you want to upload back to ImageJ as a new image, I can point you at some code for that if you're interested.

This approach should certainly work with a bunch of images. Let us know if you need more help or info...

Will.
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm

Re: Running ImageJ plugin in batch through uploaded scripts

Postby wmoore » Fri Mar 22, 2013 10:08 pm

PS: you can see a demo of the above ImageJ integration with the web python code at
https://trac.openmicroscopy.org.uk/ome/ ... ection.mov
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm

Re: Running ImageJ plugin in batch through uploaded scripts

Postby tom_deschamps » Mon Apr 01, 2013 8:16 pm

Hi Will

I forgot to thank you properly for your answer.
Do you think this is feasible by using ITK instead of ImageJ?
They have many more filtering capabilities available.
Once again, I would like to do the processing in batches, as images are pushed to the Omero server, but I would like to be able to use that on a client.
Thanks for your help!

Thomas
tom_deschamps
 
Posts: 22
Joined: Fri Mar 22, 2013 12:22 am

Re: Running ImageJ plugin in batch through uploaded scripts

Postby wmoore » Tue Apr 02, 2013 8:17 am

Hi Thomas,

If you're happy to call image processing functions on the command line from your Python script, then you can use any command line process you like, and working with a batch of images will be fine. As a 'proof of concept' I previously hooked up various EM processing packages in this way: http://cvs.openmicroscopy.org.uk/snapsh ... pting4.mov
Basically this is writing OMERO images to a local directory in some format that the command line tools can work with, then calling the command line to write files to a different directory, then uploading these back to OMERO.

When writing images back to OMERO, you can either call the omero importer on the command line,
viewtopic.php?f=6&t=895&p=3298
or use Python (E.g. PIL) to read the file, convert to numpy planes and create a new image with
Code: Select all
conn.createImageFromNumpySeq (zctPlanes, imageName, sizeZ=1, sizeC=1, sizeT=1, description=None, dataset=None)
See:
https://github.com/openmicroscopy/openm ... _.py#L2727

The examples in the movie above are a bit out of date (don't use the more recent conn method above) and they use EM packages to convert files to numpy arrays: E.g. https://github.com/ome/scripts/blob/EMA ... ocedure.py and
https://github.com/ome/scripts/blob/EMA ... ffusion.py
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm

Re: Running ImageJ plugin in batch through uploaded scripts

Postby tom_deschamps » Fri Apr 05, 2013 4:54 am

Thanks Will for your reply.
I'm going to give it a try.
tom_deschamps
 
Posts: 22
Joined: Fri Mar 22, 2013 12:22 am


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 1 guest