[ome-devel] OMERO API - Loading an Image
Vanni Galli
vanni.galli at supsi.ch
Mon Dec 12 12:48:45 GMT 2011
Dear Jean-Marie Burel,
I’m not sure if you remember, but several months ago you helped me in loading images from OMERO using the API (in Java).
You provided me with a class in order to get the images planes, called Gateway. In particular I am now using a function called getPlane, in order to get pixels data from an OMERO image:
public synchronized byte[] getPlane(long pixelsID, int z, int t, int c) throws Exception
{
RawPixelsStorePrx service = entryEncrypted.createRawPixelsStore();
try
{
service.setPixelsId(pixelsID, false);
return service.getPlane(z, c, t);
}
catch (Throwable e)
{
new Exception("cannot retrieve the plane " + "(z=" + z + ", t=" + t + ", c=" + c + ") for pixelsID: " + pixelsID, e);
}
finally
{
service.close();
}
return null;
}
What I’m trying to do now is to extract from the image also a time-dimension information (e.g.: the delta-t between the various frames of an image).
The OME schema (http://www.openmicroscopy.org/Schemas/OME/2011-06/ome.xsd) says that there is a Plane object that “holds microscope stage and image timing data for a given channel/z-section/timepoint”. How can I access this information from the API?
The code you provided me is getting a byte[] array containing the pixels data, but no time information.
Accordingly to the OME schema, there should be also a TimeIncrement attribute (when time series have a global timing specification). How can I extract this information?
Thank you very much for your help!
Best Regards,
Vanni Galli
On Feb 07, 2011, at 01:19 PM, jburel <j.burel at dundee.ac.uk> wrote:
You need to add
/**
* Returns the XY-plane identified by the passed z-section, time-point
* and wavelength.
*
* @param pixelsID The id of pixels containing the requested plane.
* @param zThe selected z-section.
* @param tThe selected time-point.
* @param cThe selected wavelength.
* @return See above.
*/
synchronized byte[] getPlane(long pixelsID, int z, int t, int c)
throws Exception
{
RawPixelsStorePrx service = entryEncrypted.createRawPixelsStore();
try {
service.setPixelsId(pixelsID, false);
return service.getPlane(z, c, t);
} catch (Throwable e) {
new Exception("Cannot retrieve the plane " +
"(z="+z+", t="+t+", c="+c+") for pixelsID: "+pixelsID, e);
}
return null;
}
to the gateway
Then you will be able to do
gateway.getPlane(id, 0, 0, 0) for example
jmarie
--
Scuola Universitaria Professionale della Svizzera Italiana
Dipartimento Tecnologie Innovative
Istituto Sistemi Informativi e Networking
Vanni Galli
Ricercatore
Galleria 2
CH - 6928 Manno
T +41 (0)58 666 65 62
vanni.galli at supsi.ch
www.supsi.ch/dti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20111212/2c695456/attachment.html>
More information about the ome-devel
mailing list