[ome-users] OMERO Figure Download

William Moore (Staff) W.Moore at dundee.ac.uk
Fri Apr 6 21:48:09 BST 2018


Hi Steve,

 It looks like the figure is getting created OK since you get the ID returned.
So it’s probably a permissions issue due to the figure file getting created
in a different group from the group that the figure file itself is in.

In the gist, we switch to the group that the figure.json file is in, but it’s possible
that the PDF is created in a different group.
The export script tries to save exported figures to the same group as the first image in the figure.

Anyway, you can repeat this line:
conn.SERVICE_OPTS.setOmeroGroup(-1)

Right before this line:
figure_pdf = conn.getObject("FileAnnotation", figure_id)

So hopefully that should find the newly created PDF OK.

I’ve updated the gist at https://gist.github.com/will-moore/d448a7abd57425734aba426f0952eff6 with
this change.

Let us know if that doesn’t work?
Regards,

  Will.


On 6 Apr 2018, at 17:28, Stephen Taylor <stephen.taylor at imm.ox.ac.uk<mailto:stephen.taylor at imm.ox.ac.uk>> wrote:

Hi Again,

We seem to be running into a problem in that certain OMERO figures are not being converted to PDFs using your gist script (you posted way back last year, see below) but some figures convert fine. Below is the error. We are using OMERO 5.4.5 and OMERO Figure version 3.1.1.

Job 1472150 ready
Waiting....
Callback received: FINISHED
Figure file:  2109025
Traceback (most recent call last):
  File "gist.py", line 84, in <module>
    figure_name = str(id)+"_"+figure_pdf.getFile().getName()
AttributeError: 'NoneType' object has no attribute 'getFile'

I have attached the json of both files. 2086989 converts to pdf and 2100620 doesn’t convert.
Both figures look fine and PDFs download ok using the web client.

Thanks for any help!

Steve
----------------------------------
Head of Computational Biology Research Group
MRC Weatherall Institute of Molecular Medicine
Oxford
www.cbrg.ox.ac.uk<http://www.cbrg.ox.ac.uk/>





From: ome-users <ome-users-bounces at lists.openmicroscopy.org.uk<mailto:ome-users-bounces at lists.openmicroscopy.org.uk>> On Behalf Of William Moore (Staff)
Sent: 01 November 2017 14:20
To: OME User Support List <ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>>
Subject: Re: [ome-users] OMERO Figure Download

Hi Steve,

By default the timeout is 10 minutes.
This can be set on the server by an admin with (milliseconds)

$ bin/omero config set omero.sessions.timeout 85000000

and this will then apply to ALL server sessions.

An admin can also set the timeout for an individual session in the CLI with (seconds)

$ bin/omero sessions timeout 1000

but unfortunately non-admins can’t do this.

There may be other ways you could keep a session alive if needed by “pinging” from a client?
e.g. "watch -n 60 omero login” but I haven’t tried this.

 Regards,

  Will.


On 1 Nov 2017, at 13:02, Stephen Taylor <stephen.taylor at imm.ox.ac.uk<mailto:stephen.taylor at imm.ox.ac.uk>> wrote:

Hi Will,

Thanks.

If I set up a session, how long does it last? Do you need to set the length for time out?

Kind regards and thanks,

Steve


From: ome-users [mailto:ome-users-bounces at lists.openmicroscopy.org.uk] On Behalf Of William Moore (Staff)
Sent: 01 November 2017 12:24
To: OME User Support List <ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>>
Subject: Re: [ome-users] OMERO Figure Download

Hi Steve,

 I’m afraid we don’t support token authentication yet, although we have been discussing it…
https://trello.com/c/CbRYR7Ty/34-session-issues
I’ve added your request to that card.

The next best thing you can do is to use an existing session ID to join a session (like a short-lived token).

You can get a session key when you login from the command line
$ bin/omero login

Or if you’re already logged-in, you can do
$ bin/omero sessions key

Then use that in your script to connect.

conn = BlitzGateway(host="localhost", port=4064)
conn.connect(SESSION_ID)

I updated https://gist.github.com/will-moore/d448a7abd57425734aba426f0952eff6
to show this.

It would be better to add command line arguments to your script instead of
hard-coding it.

Regards,

  Will.



On 31 Oct 2017, at 11:48, Stephen Taylor <stephen.taylor at imm.ox.ac.uk<mailto:stephen.taylor at imm.ox.ac.uk>> wrote:

Hi Will,

Sorry for my slow reply. I haven’t been able to reproduce this as again so may be just a blip when the machine is under load. I have noticed some of the PDFs don’t download and when I look at the ids in OMERO.figure it says ‘Data missing’. Does this mean that an image has been removed from a database which is breaking things?

On another note, does OMERO support token based authentication? There has been a concern from sys admins here that we are logging in with a username and password every time.

Thanks,

Steve



From: ome-users [mailto:ome-users-bounces at lists.openmicroscopy.org.uk] On Behalf Of William Moore (Staff)
Sent: 24 October 2017 10:39
To: OME User Support List <ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>>
Subject: Re: [ome-users] OMERO Figure Download

Hi Steve,

 I tried a simple modification to my script to export and download a handful of figures
sequentially, and this seemed to work OK.
Could you share your script and give us an idea of how many figures you
can export before you see this ConnectionRefusedException?

Also, any other info you think might be relevant?
Timing of export (do the figures contain large numbers of images), reproducibility of
this issue (do you always get this error at the same point, or just occasionally) etc.

 Thanks,

  Will.



On 20 Oct 2017, at 16:34, Stephen Taylor <stephen.taylor at imm.ox.ac.uk<mailto:stephen.taylor at imm.ox.ac.uk>> wrote:

Hi,

Ah. Spoke to soon.

Got an new error when I set a batch job to run multiple figures.

Waiting....
Traceback (most recent call last):
  File "figure2png.py", line 88, in <module>
    while proc.poll() is None:
  File "/opt/OMERO.py-5.3.5-ice35-b73/lib/python/omero_Scripts_ice.py", line 691, in poll
    return _M_omero.grid.Process._op_poll.invoke(self, ((), _ctx))
Ice.UnknownLocalException: exception ::Ice::UnknownLocalException
{
    unknown = Network.cpp:2381: Ice::ConnectionRefusedException:
connection refused: Connection refused
}

Any idea?

Steve

From: ome-users [mailto:ome-users-bounces at lists.openmicroscopy.org.uk] On Behalf Of Stephen Taylor
Sent: 20 October 2017 14:04
To: OME User Support List <ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>>
Subject: Re: [ome-users] OMERO Figure Download

Hi Will,

Thanks! This seems to fix things.

Steve

From: ome-users [mailto:ome-users-bounces at lists.openmicroscopy.org.uk] On Behalf Of William Moore (Staff)
Sent: 17 October 2017 11:37
To: OME User Support List <ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>>
Subject: Re: [ome-users] OMERO Figure Download

Hi Steve,

 I think you must have also updated OMERO.figure too, since the return key changed in OMERO.figure 3.1.0:
https://github.com/ome/omero-figure/commit/6d07fc88

You now need to use “New_Figure” everywhere instead of “File_Annotation”).
Apologies for not anticipating that this would be a breaking change.

I’ll update the gist.

 Hope that works,

 Regards,

   Will.



On 17 Oct 2017, at 08:27, Stephen Taylor <stephen.taylor at imm.ox.ac.uk<mailto:stephen.taylor at imm.ox.ac.uk>> wrote:

Hi,

Earlier this year Will kindly helped me write a script to download data from OMERO figure (seehttps://gist.github.com/will-moore/d448a7abd57425734aba426f0952eff6).

Our OMERO server just got updated to version 5.3.5.  Now line 53, if rv.get('File_Annotation'):, returns None so it never gets to the download step. Please can someone advise how I can debug this because AFAIK the figures look ok and I am a bit stuck what to do next.

I am using running the script on Ubuntu and using the OMERO.py-5.3.5-ice35-b73 libs.

Kind regards and thanks,

Steve
----------------------------------
Head of Computational Biology Research Group
MRC Weatherall Institute of Molecular Medicine
Oxford
www.cbrg.ox.ac.uk<http://www.cbrg.ox.ac.uk/>

_______________________________________________
ome-users mailing list
ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users


The University of Dundee is a registered Scottish Charity, No: SC015096
_______________________________________________
ome-users mailing list
ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users


The University of Dundee is a registered Scottish Charity, No: SC015096
_______________________________________________
ome-users mailing list
ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users


The University of Dundee is a registered Scottish Charity, No: SC015096
_______________________________________________
ome-users mailing list
ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users


The University of Dundee is a registered Scottish Charity, No: SC015096
<2086989.json><2100620.json>_______________________________________________
ome-users mailing list
ome-users at lists.openmicroscopy.org.uk<mailto:ome-users at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users


The University of Dundee is a registered Scottish Charity, No: SC015096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20180406/47e78796/attachment-0001.html>


More information about the ome-users mailing list