Hi Jmarie,
I've had a look at the those scripts but I can't find quite what I want there.
Maybe a picture might help:
- Screen Shot 2019-03-19 at 11.02.31 am.png (237.39 KiB) Viewed 1160 times
Rather than hard coding OMERO object ID in scripts I'd like to be able to get the IDs of the selected images/datasets in the currently opened Fiji-Plugin viewer.
I've made some progress along this front following the documentation here:
https://docs.openmicroscopy.org/omero/5.4.0/developers/Server/Sessions.htmlThis Jython script creates a session I can lists the open sessions.
- Code: Select all
#@ String(label="Staff/StudentID") username
#@ String(label="Email password", style='password') password
#OMERO Server details
host = "omero-app.research.uts.edu.au"
port = 4064
from ome.api import ISession
from omero import client
from ome.system import Principal
cli= client(host,port)
sessF = cli.createSession(username,password)
sess = sessF.getSessionService()
for open_sess in sess.getMyOpenSessions():
print(open_sess.getUuid())
admin = sessF.getAdminService()
cxt = admin.getEventContext()
#for d in dir(sess):
# print(d)
print(cxt.sessionId)
print(cxt.sessionUuid)
Here is the output without the FIJI plugin open
- Code: Select all
Started connection_session.py at Tue Mar 19 10:59:14 AEDT 2019
omero.rtypes$RStringI@a967c5c8
41845
a97663c0-555b-4b60-bafe-04e0bfa3f90b
Here is the output with the plugin viewer open
- Code: Select all
Started connection_session.py at Tue Mar 19 11:00:03 AEDT 2019
omero.rtypes$RStringI@7779675f
omero.rtypes$RStringI@639ed5
41847
be7b98b2-eee6-4571-abf9-8ddb9caea852
And here it is another time
- Code: Select all
Started connection_session.py at Tue Mar 19 11:00:12 AEDT 2019
omero.rtypes$RStringI@3f631e82
omero.rtypes$RStringI@639ed5
41848
4c0a1340-4c1e-48ab-8474-bda132582229
The second session Uuid is persistent and disappears when the Fiji viewer is closed so this must the the Uuid of the Fiji viewer.
I haven't worked out how to use this get the existing session yet. When I try to create a Principal as in the documents I get lots of errors about refcounts.
Any pointers?
Thanks,
Chris