We're Hiring!

Fiji (ImageJ) Import OMERO...

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.

Fiji (ImageJ) Import OMERO...

Postby sgriesha » Tue Oct 07, 2014 4:45 pm

Hi,

I have tried the new feature (import from omero into imageJ) it works well. However, I was wondering if there is a way to programmatically (through the scripting options or macro language) to populate the dialog box that comes up. Their are options for Server, Port, User, Password, ImageID but I can't seem to figure out how to reach these options through scripting. Any help would be appreciated.

Best,
Scott
sgriesha
 
Posts: 2
Joined: Tue Apr 27, 2010 4:46 pm

Re: Fiji (ImageJ) Import OMERO...

Postby jburel » Wed Oct 08, 2014 2:39 pm

Hi Scott

Could you clarify your workflow?
Do you open an image using the omero.insight-ij plugin to open an image stored in OMERO into image J.
The information like password etc are passed to the corresponding B-F plugin but not exposed. (e.g no entry in recorder).
What are you trying to achieve?
Once an OMERO session is created you can join it and save data back to OMERO if this is the case.
we are currently working on such workflow

Regards
Jmarie
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee

Re: Fiji (ImageJ) Import OMERO...

Postby sgriesha » Wed Oct 08, 2014 3:49 pm

Hi,

Sorry I wasn't more clear. The workflow I was envisioning was to have a Fiji script (using jython in Fiji) download an image from an OMERO server using its image ID, do some automated measurements close the image and open the next looping across an image ID range. Basically measure something in image IDs 5-50. I was hoping I could somehow tell the OMERO... image import function what image ID to import using a script. If their are better ways to do this that would be great as well.

Scott
sgriesha
 
Posts: 2
Joined: Tue Apr 27, 2010 4:46 pm

Re: Fiji (ImageJ) Import OMERO...

Postby jburel » Thu Oct 09, 2014 2:46 pm

Hi Scott
I wrote a little example reading a plane of a given image stored in OMERO and ran it into Fiji Jython interpreter.
You will need to add the "omero_client.jar" to be able to connect to OMERO
In this example I do not keep the session alive. OMERO session will expire after 10mins (default set server side).

Code: Select all
from omero import client
from omero.api import ServiceFactoryPrx
from omero.api import IContainerPrx
from omero.api import RawPixelsStorePrx
from omero.model import Image
from java.util import ArrayList
from java.lang import Long
from java.lang import Boolean

# retrieve a the plane of a given image
#create a connection using the default port
c = client(host)
entry = c.createSession(username, password)
# for unsecure session (faster) do
# unsecureClient = secureClient.createClient(false)
# entryUnencrypted = unsecureClient.getSession()

# retrieve the image
svc = entry.getContainerService()
ids = ArrayList()
ids.add(id)
images = svc.getImages("Image", ids, None)
image = images.get(0)
pixelsID = image.getPrimaryPixels().getId().getValue()
# read a plane
store = entry.createRawPixelsStore()
store.setPixelsId(pixelsID, Boolean.FALSE)
plane = store.getPlane(z, w, t) #return an array of byte
print plane
c.closeSession()



Cheers

Jmarie
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 1 guest