We're Hiring!

Accessing and displaying image in a remote DB

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please 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

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Accessing and displaying image in a remote DB

Postby bhcho » Thu Jul 21, 2011 8:32 pm

Hi,

As you may guess, we want to connect to multiple OMERO servers using OMERO.web.
What we want to do is...Assuming I'm logged on to my server, I will get the connection to another remote server, want to get some information from the server, and display some images (in the remote server).

0.
Firstly, I think we need to make a new client object to connect to another remote server. I guess I cannot use the Blitzgateway for the remote server.

1.
I wonder whether I can check the accessibility of an image of the remote server (whether I can look at the image or not), given its image ID framework. Is there any method to do this?

2.
If I can have the permission to that image, how can I display the image (which is in the remote server) on my OMERO.web page (which is basically connected to my server).
From an OMERO.web template page, I can display thumbnail of an image by
Code: Select all
<img id="{{ c.id }}" src="{% url render_thumbnail_resize 32 c.id  %}" alt="image" title="{{ c.name }}"/>

And for the "metadata_details" (which is the right panel of the "DATA" page)
Code: Select all
$("div#metadata_details").html('<iframe width="370" height="'+h+'" src="/webclient/metadata_details/'+obj[0]+'/'+obj[1]+'/" id="metadata_details" name="metadata_details"></iframe>');


Those two methods are basically just passing the image ID, assuming those images are in the local OMERO DB.
But what about the case of remote DB?

best,
BK
bhcho
 
Posts: 236
Joined: Mon Apr 05, 2010 2:15 pm

Re: Accessing and displaying image in a remote DB

Postby jmoore » Fri Jul 22, 2011 7:33 am

bhcho wrote:0.
Firstly, I think we need to make a new client object to connect to another remote server. I guess I cannot use the Blitzgateway for the remote server.

Definitely. One omero.client/BlitzGateway pair per server.

bhcho wrote:1.
I wonder whether I can check the accessibility of an image of the remote server (whether I can look at the image or not), given its image ID framework. Is there any method to do this?

If you can get access to the image given the ID then you'll be able to look at it. "IQuery.find("Image", ID)" will return null if you are not allowed to access the image (or if it was deleted, for example).

bhcho wrote:2.
If I can have the permission to that image, how can I display the image (which is in the remote server) on my OMERO.web page (which is basically connected to my server).
From an OMERO.web template page, I can display thumbnail of an image by
Code: Select all
<img id="{{ c.id }}" src="{% url render_thumbnail_resize 32 c.id  %}" alt="image" title="{{ c.name }}"/>

And for the "metadata_details" (which is the right panel of the "DATA" page)
Code: Select all
$("div#metadata_details").html('<iframe width="370" height="'+h+'" src="/webclient/metadata_details/'+obj[0]+'/'+obj[1]+'/" id="metadata_details" name="metadata_details"></iframe>');



Those two methods are basically just passing the image ID, assuming those images are in the local OMERO DB.
But what about the case of remote DB?


Will and Ola may have an easy way to workaround this, but this is a completely new requirement that you should assume is not covered by any of our infrastructure. All decorators for checking login, etc., expect to talk to a single server.

Cheers,
~Josh.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Accessing and displaying image in a remote DB

Postby wmoore » Mon Jul 25, 2011 11:11 pm

Hi BK,

Sorry for the delay.
We have been discussing this a little but wanted to have a good idea before we propose anything.

As Josh said, this requirement is totally new and you will have to get a little deeper into the web framework in order to customise the behavior you want.

You need to understand that there is not really a "remote" server vv a "non-remote" server.
The web framework can connect equally to any server since the whole stack is really just a Python client. See the diagram in https://trac.openmicroscopy.org.uk/ome/wiki/OmeroWeb

You will be able to use the blitz gateway in the same way that you do now, but you will need to update all the methods that you wish to use against the "non-default" server.

E.g. render_thumbnail/<server-id>/<image-id>/

We need to discuss the best strategy for doing this. But in the meantime you should try to familiarise yourself with the code that retrieves a Blitz connection from the http request parameters.
i.e webgateway/views.py getBlitzConnection ()

Unfortunately this is less well documented in 4.2 than in 4.3, so you may wish to look at the 4.3 docs too: http://hudson.openmicroscopy.org.uk/job ... Connection

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


Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest