[ome-devel] Download an original file with a remote access

Olivier Arnaiz arnaiz at cgm.cnrs-gif.fr
Tue Aug 4 10:02:19 BST 2009


Hi,

Thank you ... this is perfect.

I have another question :
Is there a way to get the metadata contained in my original file ?
I saw the method : getIMetadataPrx but i am not sure how to use it...

Thanks again
Olivier

Le 3 août 09 à 17:31, Michael Porter a écrit :

> Hi Olivier
>
> The Image object your get from the gateway doesn't contain an  
> 'image' as we think about it. You can use the Pixels object to get  
> raw plane data via a method in the gateway. I use it though Matlab,  
> not sure how to construct this correctly in Java, but it's along  
> the lines of....
>
> pixels = gateway.getPixelsFromImage(id);
> pixelsId = pixels.get(0).getId().getValue();
> rawPlane = gateway.getPlane(pixelsId, z, c , t);
> plane2D = omerojava.util.GatewayUtils.getPlane2D(pixels.get(0),  
> rawPlane);
> plane = plane2D.getPixelsArrayAsDouble(1);
> The way I understand it is the rawPlane comes down as a bytestream,  
> and the GatewayUtils uses image dimension information in the Pixels  
> object to reconstruct the 2D plane. Then you can convert it to the  
> correct type, in my case double. Obviously you have to repeat this  
> process for every z-section/channel etc in your image.
>
> Hope this helps!
>
> Michael.
>
>
> -- 
> Michael Porter
> Wellcome Trust Centre for
> Gene Regulation and Expression
> College of Life Sciences
> University of Dundee
> Dow Street
> Dundee
> United Kingdom
> DD1 5EH
>
> +44(0)1382 388142
> m.porter at dundee.ac.uk
>
> The University of Dundee is a registered Scottish charity, No:  
> SC015096
>
>
> >>> Olivier Arnaiz <arnaiz at cgm.cnrs-gif.fr> 03/08/2009 16:17 >>>
> Hello,
>
> I have the latest version of OMERO.server (4.0.3) and I would like  
> to have a remote access to an image file in a Java Program:
> I have written these lines :
>
> omero.client client = new omero.client("localhost");
>         ServiceFactoryPrx sf = client.createSession("me", "***");
>
> omero.api.GatewayPrx gateway = sf.createGateway();
> long imageId = 12 ;
> omero.model.Image image = gateway.getImage(imageId);
>
> System.out.println("Image_name="+image.getName().getValue());
>
>
> omero.model.Pixels pixel = gateway.getPixels(imageId);
> System.out.println("Pixel_X="+pixel.getSizeX().getValue());
> System.out.println("Pixel_Y="+pixel.getSizeY().getValue());
> System.out.println("Pixel_Z="+pixel.getSizeZ().getValue());
> System.out.println("Pixel_C="+pixel.getSizeC().getValue());
> System.out.println("Pixel_T="+pixel.getSizeT().getValue());
>
>
> How can I convert my omero.model.Image into a classical Image  
> Object or an object readable with the loci package ?
> Is it possible to download the original file ?
>
> Do you have any suggestions ?
> Thanks
> Olivier
>
>
> --
> Olivier Arnaiz
> CGM-CNRS
> 91198 Gif-sur-Yvette
> 01 69 82 43 75
>
> ParameciumDB:
>   http://paramecium.cgm.cnrs-gif.fr/
>
>
>
>
>
> The University of Dundee is a registered Scottish charity, No:  
> SC015096
>

--
Olivier Arnaiz
CGM-CNRS
91198 Gif-sur-Yvette
01 69 82 43 75

ParameciumDB:
   http://paramecium.cgm.cnrs-gif.fr/




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20090804/4bb2eacc/attachment.htm 


More information about the ome-devel mailing list