<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thanks for your reply!<div><br></div><div><br></div><div><blockquote type="cite"><div>If you give us an idea of what you are looking for in the clients (download a dataset, download archived images, etc.), we'll look at it and see what we can do.</div><div><br></div></blockquote></div><div><br></div><div>The minimal functionality we're looking for is to be able to download all images in a dataset.  We haven't been archiving images so far, but we could do that in the future (hardly any of our images have been uploaded yet) if that functionality is easier to implement than creating new image files.</div><div><br></div><div><blockquote type="cite"><div>Within the OMERO clients, no.  But you can use the scripting interface to do this.  This is, for example, how we do our Matlab processing.  See</div><div><br></div><div><a href="http://trac.openmicroscopy.org.uk/omero/wiki/OmeroScripts">http://trac.openmicroscopy.org.uk/omero/wiki/OmeroScripts</a></div><div><br></div></blockquote></div><div><br></div><div>Thanks for the link to the scripting interface!  I've also been poking around the java api in an attempt to implement some sort of batch download and have pieced together a client that can connect and read projects and datasets (and get the appropriate links between them, etc.), but whenever I try to query to get images I get exceptions (see code snippets and stack traces below).  This occurs using several different modes of attempting to access the image data, including using IPixelsPrx.retrievePixDescription, IQueryPrx.findAllByQuery (with a query that would return images), and GatewayPrx.getImages.  The analogous methods in GatewayPrx and IQueryPrx for projects and datasets work normally.  I've also verified that the images and datasets with the ids I'm looking for exist on the server both using the omero.insight client and manual queries to the postgresql database on the server.  Additionally, when I run the same query (which should return 8 results) with IQueryPrx.findByQuery, this method correctly throws an exception saying that it has found 8 results.  This puzzles me, since it seems to be able to query the database properly, but there seems to be some trouble between when it queries and when it returns the images.</div><div><br></div><div>I'm not sure whether this is a bug or whether I'm missing some difference between getting images and getting projects/datasets off the server.  Any thoughts would be greatly appreciated!</div><div><br></div><div>Thanks,</div><div><br></div><div>Colin</div><div><br></div><div><br></div><div><br></div><div><br></div><div>Code snippet (with the service factory previously set up by the same code through which I can correctly access all the projects and datasets):</div><div><br></div><div>myPixelService = myServiceFactory.getPixelsService();</div><div>Pixels p = myPixelService.retrievePixDescription(1L);</div><div><br></div><div>gives the exception (with the stack trace until it enters the code snippet):</div><div><br></div><div><div>Ice.MarshalException</div><div>    reason = (null)</div><div>        at IceInternal.BasicStream.typeToClass(BasicStream.java:2287)</div><div>        at IceInternal.BasicStream.findClass(BasicStream.java:2204)</div><div>        at IceInternal.BasicStream.loadObjectFactory(BasicStream.java:2071)</div><div>        at IceInternal.BasicStream.readObject(BasicStream.java:1450)</div><div>        at omero.model.Image.__read(Image.java:2079)</div><div>        at IceInternal.BasicStream.readObject(BasicStream.java:1500)</div><div>        at IceInternal.BasicStream.readPendingObjects(BasicStream.java:1632)</div><div>        at omero.api._IPixelsDelM.retrievePixDescription(_IPixelsDelM.java:513)</div><div>        at omero.api.IPixelsPrxHelper.retrievePixDescription(IPixelsPrxHelper.java:592)</div><div>        at omero.api.IPixelsPrxHelper.retrievePixDescription(IPixelsPrxHelper.java:564)</div></div><div>...</div><div><br></div><div><br></div><div>Another snippet that gives this exception:</div><div><br></div><div><div>GatewayPrx myGateway = myServiceFactory.createGateway();</div><div>List<Long> datasetIds = new Vector<Long>();</div><div>datasetIds.add(1L);</div><div>datasetIds.add(2L);</div><div>List<Dataset> datasetList = myGateway.getDatasets(datasetIds, false);</div><div>List<Image> imageList = myGateway.getImages(omero.api.ContainerClass.Dataset, datasetIds);</div></div><div><br></div><div>which leads to:</div><div><br></div><div><div>Ice.MarshalException</div><div>    reason = (null)</div><div>        at IceInternal.BasicStream.typeToClass(BasicStream.java:2287)</div><div>        at IceInternal.BasicStream.findClass(BasicStream.java:2204)</div><div>        at IceInternal.BasicStream.loadObjectFactory(BasicStream.java:2071)</div><div>        at IceInternal.BasicStream.readObject(BasicStream.java:1450)</div><div>        at omero.model.Image.__read(Image.java:2071)</div><div>        at IceInternal.BasicStream.readObject(BasicStream.java:1500)</div><div>        at IceInternal.BasicStream.readPendingObjects(BasicStream.java:1632)</div><div>        at omero.api._GatewayDelM.getImages(_GatewayDelM.java:770)</div><div>        at omero.api.GatewayPrxHelper.getImages(GatewayPrxHelper.java:934)</div><div>        at omero.api.GatewayPrxHelper.getImages(GatewayPrxHelper.java:906)</div></div><div><br></div><div><br></div><div>Likewise, the snippet:</div><div><br></div><div>myQueryService = myServiceFactory.getQueryService();</div><div>String query_string = "from Image";</div><div>List myImages = myQueryService.findAllByQuery(query_string, null);</div><div><br></div><div>gives a similar (?) exception:</div><div><br></div><div><div>Ice.UnmarshalOutOfBoundsException</div><div>    reason = (null)</div><div>        at IceInternal.BasicStream.readLong(BasicStream.java:979)</div><div>        at omero.sys.CountMapHelper.read(CountMapHelper.java:43)</div><div>        at omero.model.Image.__read(Image.java:2074)</div><div>        at IceInternal.BasicStream.readObject(BasicStream.java:1500)</div><div>        at IceInternal.BasicStream.readPendingObjects(BasicStream.java:1632)</div><div>        at omero.api._IQueryDelM.findAllByQuery(_IQueryDelM.java:281)</div><div>        at omero.api.IQueryPrxHelper.findAllByQuery(IQueryPrxHelper.java:320)</div><div>        at omero.api.IQueryPrxHelper.findAllByQuery(IQueryPrxHelper.java:292)</div></div><div>...</div><div><br></div><div>Interestingly, however, when I run the same snippet with the findByQuery function with return types appropriately modified (which should produce an exception since it will find more than one image), I get:</div><div><br></div><div><div>omero.InternalException</div><div>    serverStackTrace = "ome.conditions.InternalException:  Wrapped Exception: (org.springframework.dao.IncorrectResultSizeDataAccessException):</div><div>                        query did not return a unique result: 8</div></div><div><br></div><div>...</div><div><br></div><div><div>serverExceptionClass = "ome.conditions.InternalException"</div><div>    message = " Wrapped Exception: (org.springframework.dao.IncorrectResultSizeDataAccessException):</div><div>               query did not return a unique result: 8"</div><div>        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)</div><div>        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)</div><div>        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)</div><div>        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)</div><div>        at java.lang.Class.newInstance0(Class.java:350)</div><div>        at java.lang.Class.newInstance(Class.java:303)</div><div>        at IceInternal.BasicStream$DynamicUserExceptionFactory.createAndThrow(BasicStream.java:2127)</div><div>        at IceInternal.BasicStream.throwException(BasicStream.java:1541)</div><div>        at IceInternal.Outgoing.throwUserException(Outgoing.java:442)</div><div>        at omero.api._IQueryDelM.findByQuery(_IQueryDelM.java:436)</div><div>        at omero.api.IQueryPrxHelper.findByQuery(IQueryPrxHelper.java:524)</div><div>        at omero.api.IQueryPrxHelper.findByQuery(IQueryPrxHelper.java:496)</div></div><div><br></div><div><br></div><div>This correctly finds that it should return 8 results.</div><div><br></div><div><br><div><div>On 20 Apr 2009, at 6:02 AM, Jason Swedlow wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Colin-<div><br></div><div>Thanks for your email.</div><div><br><div><div>On 18 Apr 2009, at 21:15, Colin Fuller wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi,<br><br>I've just set up an omero server (beta 4.0.1), and it's working out  <br>quite well so far.  One thing I haven't figured out how to do is do  <br>some sort of batch export of images from the server in the  <br>omero.clients programs.  </div></blockquote><div><br></div><div>Great idea, and something that we have certainly talked about, but indeed, not there yet.</div><br><blockquote type="cite"><div>I can save them one at a time through the  <br>viewer, but we generally operate on rather large datasets, so this is  <br>not a feasible way for people to access get their images in order to  <br>run them through analysis programs.  Is there some way to do this in  <br>the client programs that I haven't found in the documentation?</div></blockquote><div><br></div><div>Within the OMERO clients, no.  But you can use the scripting interface to do this.  This is, for example, how we do our Matlab processing.  See</div><div><br></div><div><a href="http://trac.openmicroscopy.org.uk/omero/wiki/OmeroScripts">http://trac.openmicroscopy.org.uk/omero/wiki/OmeroScripts</a></div><div><br></div><div>If you give us an idea of what you are looking for in the clients (download a dataset, download archived images, etc.), we'll look at it and see what we can do.</div><div><br></div><div>Cheers,</div><div><br></div><div>Jason</div><div><br></div></div><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; 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; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="font-family: Helvetica; "><br class="Apple-interchange-newline"><br class="khtml-block-placeholder"></div><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">**************************</span></div><div style="font-family: Helvetica; "><font class="Apple-style-span" face="Arial">Wellcome Trust Centre for Gene Regulation & Expression</font></div><div style="font-family: Helvetica; "><font class="Apple-style-span" face="Arial">College of Life Sciences</font></div><div style="font-family: Helvetica; "><font class="Apple-style-span" face="Arial">MSI/WTB/JBC Complex</font></div><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">University of Dundee</span></div><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">Dow Street</span></div><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">Dundee  DD1 5EH</span></div><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">United Kingdom</span></div><div style="font-family: Helvetica; "><br style="font-family: Helvetica; "></div><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">phone (01382) 385819</span></div><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">Intl phone:  44 1382 385819 </span></div><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">FAX   (01382) 388072 </span></div><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">email: <a href="mailto:jason@lifesci.dundee.ac.uk">jason@lifesci.dundee.ac.uk</a></span></div><div style="font-family: Helvetica; "><br style="font-family: Helvetica; "></div><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">Lab Page: <a href="http://www.dundee.ac.uk/lifesciences/swedlow/">http://www.dundee.ac.uk/lifesciences/swedlow/</a></span></div><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">Open Microscopy Environment: <a href="http://openmicroscopy.org">http://openmicroscopy.org</a></span></div><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">**************************</span></div><div style="font-family: Helvetica; "><br class="webkit-block-placeholder"></div><div style="font-family: Helvetica; "><div>The University of Dundee is a Scottish Registered Charity, No. SC015096.</div></div><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline"> </div><br></div></div></blockquote></div><br></div></body></html>