Page 1 of 1

Getting a plane (z, c, t) image from webgateway (omero.web)

PostPosted: Tue Apr 12, 2016 3:23 pm
by ofuica
Hi,

We saw that is possible get rendered images using the webgateway API (Omero.web) and also one can retrieve the original file. Instead of these options, we are wondering if is possible get the raw pixel buffer image for a given dimension z, c and t through this service. (As example: using omero.client java API, one can do this using getPlane(z, c, t) function).

We were investigating this subject, just reading the documentation available and reviewing the webgateway code on github, we didn't find anything. It seems that is not possible to do, but we believed that there are something that we missed.

So, the question is:
Is there any function or mechanism that allows us to do that ?

Thanks for any help you can provide.

Best regards

Osvaldo

Re: Getting a plane (z, c, t) image from webgateway (omero.w

PostPosted: Wed Apr 13, 2016 11:22 am
by wmoore
Hi Osvaldo,

You can't get raw pixel data via the webgateway, but you can get it with the underlying Python OMERO API.

See https://www.openmicroscopy.org/site/sup ... ata-access

Code: Select all
plane = pixels.getPlane(z, c, t)      # get a numpy array.


We don't support this in the web since the webclient never displays the raw pixel data for a plane, and there's not a particularly nice way to return a plane of raw pixel data as json or html although it could be done if you need this?

Hope that helps,

Will.

Re: Getting a plane (z, c, t) image from webgateway (omero.w

PostPosted: Wed Apr 13, 2016 11:51 am
by Stephane
Hi Will,

Thanks for your reply, I'm working with Osvaldo and maybe i can explain why we are trying to get the raw data from the webgateway services. Osvaldo is actually developing a plugin for Icy software so we can open image from Omero directly in Icy (to start with). We really want to bring that connection between Icy and Omero but we are trying to find the best way for it.
Currently we saw these 2 solutions : webgateway services or directly Omero java API (or the python wrapper which is based on i believe).
Icy is developed in java so it makes sense to use the Omero java API directly, the problem is that API evolve at each version so if we develop a plugin based on version 5.1.2 for instance, it may not work anymore in version 5.2.x. That is a big issue for us as we can't maintain plugins for each existing version, we want a plugin which can work for all version and based on a fixed API. OME team is actually maintaining the ImageJ connector plugin so they can deliver it at each new Omero release but for Icy you can understand that we just can't do that... We already discussed some years ago about this issue which prevented us to make a reliable connector with Omero and that it would be really nice to have a fixed API / web services to communicate with Omero. Today the webgateway services look like a good solution to do it but it misses some lower level accesses (the famous getPlane(..) method for instance). Or maybe there are better suited solutions available we are not aware of ? Thanks for your help !

- Stephane

Re: Getting a plane (z, c, t) image from webgateway (omero.w

PostPosted: Wed Apr 13, 2016 1:30 pm
by wmoore
Hi Stephane,

I don't think there's an existing way to get a single plane of raw pixel data.
Probably the best way to support this in future is to return the raw pixel data as a single-plane tiff image (since this would include the pixel type etc).

One way you could try to access the raw pixel data now is to simply download the original image file(s) and use BioFormats to read them (as if the user was opening a local file).

You can download the original file for an image at
webgateway/archived_files/download/:iid

However, if the data is stored in multiple files, this will zip them up and return a zip.
Hope that helps,

Will.

Re: Getting a plane (z, c, t) image from webgateway (omero.w

PostPosted: Thu Apr 14, 2016 11:46 am
by Stephane
H Will,

Thanks for your reply. Actually we saw that method so we could retrieve the original TIFF file from the webgateway service but that is definitely not an optimal way to do it, because the web service has to encapsulate the raw data and encode it in a TIFF file, then we retrieve it that file, save it on disk on open it using Bio-Formats reader... really over-killing when we just basically want the raw array of pixel data. We could do it from the Java Omero API of course but the idea is to have access to that from a fixed API.
So it appears we can't do that currently but do you think that is a feature that could be implemented at some point ? Honestly i'm a bit surprised there is no available API / services (separated from internal / low level API which can change) to offer than kind of inter operability with externals applications (image analysis applications for instance), it looks like a key point for me. Thanks.

Re: Getting a plane (z, c, t) image from webgateway (omero.w

PostPosted: Fri Apr 15, 2016 12:02 pm
by wmoore
Hi Stephane,

Apologies that there's not a solution that works for you just now.

We are currently discussing a new json web API at https://github.com/openmicroscopy/design/issues/24 although the scope is quite limited so far and hasn't extended to access of raw data.

We will keep your requirements in mind as we progress.

Regards,

Will.