<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div>Hi,</div><div><br></div><div>Thank you ... this is perfect.</div><div><br></div><div>I have another question :</div><div>Is there a way to get the metadata contained in my original file ?</div><div>I saw the method : getIMetadataPrx but i am not sure how to use it...</div><div><br></div><div>Thanks again</div><div>Olivier</div><br><div><div>Le 3 août 09 à 17:31, Michael Porter a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"> <div>Hi Olivier</div> <div> </div> <div>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....</div> <div> </div> <div>pixels = gateway.getPixelsFromImage(id);<br>pixelsId = pixels.get(0).getId().getValue();<br>rawPlane = gateway.getPlane(pixelsId, z, c , t);<br>plane2D = omerojava.util.GatewayUtils.getPlane2D(pixels.get(0), rawPlane);<br>plane = plane2D.getPixelsArrayAsDouble(1);<br></div> <div>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.</div> <div> </div> <div>Hope this helps!</div> <div> </div> <div>Michael.</div> <div> </div> <div> </div> <div>-- <br>Michael Porter<br>Wellcome Trust Centre for<br>Gene Regulation and Expression<br>College of Life Sciences<br>University of Dundee<br>Dow Street<br>Dundee<br>United Kingdom<br>DD1 5EH<br><br>+44(0)1382 388142<br><a href="mailto:m.porter@dundee.ac.uk">m.porter@dundee.ac.uk</a><br><br>The University of Dundee is a registered Scottish charity, No: SC015096<br><br></div> <div> </div> <div>>>> Olivier Arnaiz <<a href="mailto:arnaiz@cgm.cnrs-gif.fr">arnaiz@cgm.cnrs-gif.fr</a>> 03/08/2009 16:17 >>><br></div> <div style="MARGIN: 0px"><span style="WHITE-SPACE: pre" class="Apple-style-span"><font class="Apple-style-span" size="3"><span style="FONT-SIZE: 12px" class="Apple-style-span">Hello,</span></font></span></div> <div style="MARGIN: 0px"><span style="WHITE-SPACE: pre" class="Apple-style-span"><br></span></div> <div style="MARGIN: 0px"><span style="WHITE-SPACE: pre" class="Apple-style-span">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:</span></div> <div style="MARGIN: 0px"><span style="WHITE-SPACE: pre" class="Apple-style-span">I have written these lines :</span></div> <div style="MARGIN: 0px"><span style="WHITE-SPACE: pre" class="Apple-style-span"><br></span></div> <div style="MARGIN: 0px"><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span">omero.client client = new omero.client("localhost");</span></font></div> <div style="MARGIN: 0px"><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"> ServiceFactoryPrx sf = client.createSession("me", "***");</span></font></div><p style="MARGIN: 0px; MIN-HEIGHT: 14px"><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><br class="khtml-block-placeholder"></p> <div style="MARGIN: 0px"><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span">omero.api.GatewayPrx gateway = sf.createGateway();</span></font></div> <div style="MARGIN: 0px"><font class="Apple-style-span" face="Courier"><span style="WHITE-SPACE: pre" class="Apple-style-span"><span style="WHITE-SPACE: pre" class="Apple-tab-span"></span>long imageId = 12 ;</span></font></div> <div style="MARGIN: 0px"><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span">omero.model.Image image = gateway.getImage(imageId);</span></font></div> <div style="MARGIN: 0px"><font class="Apple-style-span" face="Courier"><br></font></div> <div style="MARGIN: 0px"><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span">System.out.println("Image_name="+image.getName().getValue());</span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"><br class="khtml-block-placeholder"></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"><br class="khtml-block-placeholder"></span></font></div> <div style="MARGIN: 0px"><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span">omero.model.Pixels pixel = gateway.getPixels(imageId);</span></font></div> <div style="MARGIN: 0px"><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span">System.out.println("Pixel_X="+pixel.getSizeX().getValue());</span></font></div> <div style="MARGIN: 0px"><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span">System.out.println("Pixel_Y="+pixel.getSizeY().getValue());</span></font></div> <div style="MARGIN: 0px"><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span">System.out.println("Pixel_Z="+pixel.getSizeZ().getValue());</span></font></div> <div style="MARGIN: 0px"><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span">System.out.println("Pixel_C="+pixel.getSizeC().getValue());</span></font></div> <div style="MARGIN: 0px"><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><span style="WHITE-SPACE: pre" class="Apple-tab-span"><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span"></span></font></span><font class="Apple-style-span" size="3" face="Courier"><span style="FONT-SIZE: 12px" class="Apple-style-span">System.out.println("Pixel_T="+pixel.getSizeT().getValue());</span></font></div> <div style="MARGIN: 0px"><font class="Apple-style-span" face="Courier"><br></font></div> <div style="MARGIN: 0px"><font class="Apple-style-span" face="Courier"><br></font></div> <div style="MARGIN: 0px">How can I convert my omero.model.Image into a classical Image Object or an object readable with the loci package ? </div> <div style="MARGIN: 0px">Is it possible to download the original file ?</div> <div style="MARGIN: 0px"><br></div> <div style="MARGIN: 0px">Do you have any suggestions ?</div> <div style="MARGIN: 0px">Thanks</div> <div style="MARGIN: 0px">Olivier</div> <div><br></div><br> <div><span style="FONT-SIZE: 12px" class="Apple-style-span"> <div style="MARGIN: 0px">--</div> <div style="MARGIN: 0px">Olivier Arnaiz</div> <div style="MARGIN: 0px">CGM-CNRS</div> <div style="MARGIN: 0px">91198 Gif-sur-Yvette</div> <div style="MARGIN: 0px">01 69 82 43 75</div> <div style="MARGIN: 0px"><br class="khtml-block-placeholder"></div> <div style="MARGIN: 0px">ParameciumDB:</div> <div style="MARGIN: 0px"> <a href="http://paramecium.cgm.cnrs-gif.fr">http://paramecium.cgm.cnrs-gif.fr</a>/</div> <div><br class="khtml-block-placeholder"></div> <div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></div><br><br><p> The University of Dundee is a registered Scottish charity, No: SC015096 </p> </blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">--</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Olivier Arnaiz</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">CGM-CNRS</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">91198 Gif-sur-Yvette</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">01 69 82 43 75</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br class="khtml-block-placeholder"></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">ParameciumDB:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "> <a href="http://paramecium.cgm.cnrs-gif.fr">http://paramecium.cgm.cnrs-gif.fr</a>/</div><div><br class="khtml-block-placeholder"></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span> </div><br></body></html>