[ome-users] omero image exports
Colin Fuller
cjfuller at gmail.com
Wed Apr 22 08:34:56 BST 2009
Thanks for your reply!
> 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.
>
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.
> 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
>
> http://trac.openmicroscopy.org.uk/omero/wiki/OmeroScripts
>
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.
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!
Thanks,
Colin
Code snippet (with the service factory previously set up by the same
code through which I can correctly access all the projects and
datasets):
myPixelService = myServiceFactory.getPixelsService();
Pixels p = myPixelService.retrievePixDescription(1L);
gives the exception (with the stack trace until it enters the code
snippet):
Ice.MarshalException
reason = (null)
at IceInternal.BasicStream.typeToClass(BasicStream.java:2287)
at IceInternal.BasicStream.findClass(BasicStream.java:2204)
at IceInternal.BasicStream.loadObjectFactory(BasicStream.java:
2071)
at IceInternal.BasicStream.readObject(BasicStream.java:1450)
at omero.model.Image.__read(Image.java:2079)
at IceInternal.BasicStream.readObject(BasicStream.java:1500)
at
IceInternal.BasicStream.readPendingObjects(BasicStream.java:1632)
at
omero.api._IPixelsDelM.retrievePixDescription(_IPixelsDelM.java:513)
at
omero
.api.IPixelsPrxHelper.retrievePixDescription(IPixelsPrxHelper.java:592)
at
omero
.api.IPixelsPrxHelper.retrievePixDescription(IPixelsPrxHelper.java:564)
...
Another snippet that gives this exception:
GatewayPrx myGateway = myServiceFactory.createGateway();
List<Long> datasetIds = new Vector<Long>();
datasetIds.add(1L);
datasetIds.add(2L);
List<Dataset> datasetList = myGateway.getDatasets(datasetIds, false);
List<Image> imageList =
myGateway.getImages(omero.api.ContainerClass.Dataset, datasetIds);
which leads to:
Ice.MarshalException
reason = (null)
at IceInternal.BasicStream.typeToClass(BasicStream.java:2287)
at IceInternal.BasicStream.findClass(BasicStream.java:2204)
at IceInternal.BasicStream.loadObjectFactory(BasicStream.java:
2071)
at IceInternal.BasicStream.readObject(BasicStream.java:1450)
at omero.model.Image.__read(Image.java:2071)
at IceInternal.BasicStream.readObject(BasicStream.java:1500)
at
IceInternal.BasicStream.readPendingObjects(BasicStream.java:1632)
at omero.api._GatewayDelM.getImages(_GatewayDelM.java:770)
at omero.api.GatewayPrxHelper.getImages(GatewayPrxHelper.java:
934)
at omero.api.GatewayPrxHelper.getImages(GatewayPrxHelper.java:
906)
Likewise, the snippet:
myQueryService = myServiceFactory.getQueryService();
String query_string = "from Image";
List myImages = myQueryService.findAllByQuery(query_string, null);
gives a similar (?) exception:
Ice.UnmarshalOutOfBoundsException
reason = (null)
at IceInternal.BasicStream.readLong(BasicStream.java:979)
at omero.sys.CountMapHelper.read(CountMapHelper.java:43)
at omero.model.Image.__read(Image.java:2074)
at IceInternal.BasicStream.readObject(BasicStream.java:1500)
at
IceInternal.BasicStream.readPendingObjects(BasicStream.java:1632)
at omero.api._IQueryDelM.findAllByQuery(_IQueryDelM.java:281)
at
omero.api.IQueryPrxHelper.findAllByQuery(IQueryPrxHelper.java:320)
at
omero.api.IQueryPrxHelper.findAllByQuery(IQueryPrxHelper.java:292)
...
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:
omero.InternalException
serverStackTrace = "ome.conditions.InternalException: Wrapped
Exception:
(org.springframework.dao.IncorrectResultSizeDataAccessException):
query did not return a unique result: 8
...
serverExceptionClass = "ome.conditions.InternalException"
message = " Wrapped Exception:
(org.springframework.dao.IncorrectResultSizeDataAccessException):
query did not return a unique result: 8"
at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun
.reflect
.NativeConstructorAccessorImpl
.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun
.reflect
.DelegatingConstructorAccessorImpl
.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:
494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at IceInternal.BasicStream
$DynamicUserExceptionFactory.createAndThrow(BasicStream.java:2127)
at IceInternal.BasicStream.throwException(BasicStream.java:
1541)
at IceInternal.Outgoing.throwUserException(Outgoing.java:442)
at omero.api._IQueryDelM.findByQuery(_IQueryDelM.java:436)
at omero.api.IQueryPrxHelper.findByQuery(IQueryPrxHelper.java:
524)
at omero.api.IQueryPrxHelper.findByQuery(IQueryPrxHelper.java:
496)
This correctly finds that it should return 8 results.
On 20 Apr 2009, at 6:02 AM, Jason Swedlow wrote:
> Hi Colin-
>
> Thanks for your email.
>
> On 18 Apr 2009, at 21:15, Colin Fuller wrote:
>
>> Hi,
>>
>> I've just set up an omero server (beta 4.0.1), and it's working out
>> quite well so far. One thing I haven't figured out how to do is do
>> some sort of batch export of images from the server in the
>> omero.clients programs.
>
> Great idea, and something that we have certainly talked about, but
> indeed, not there yet.
>
>> I can save them one at a time through the
>> viewer, but we generally operate on rather large datasets, so this is
>> not a feasible way for people to access get their images in order to
>> run them through analysis programs. Is there some way to do this in
>> the client programs that I haven't found in the documentation?
>
> 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
>
> http://trac.openmicroscopy.org.uk/omero/wiki/OmeroScripts
>
> 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.
>
> Cheers,
>
> Jason
>
>
>
> **************************
> Wellcome Trust Centre for Gene Regulation & Expression
> College of Life Sciences
> MSI/WTB/JBC Complex
> University of Dundee
> Dow Street
> Dundee DD1 5EH
> United Kingdom
>
> phone (01382) 385819
> Intl phone: 44 1382 385819
> FAX (01382) 388072
> email: jason at lifesci.dundee.ac.uk
>
> Lab Page: http://www.dundee.ac.uk/lifesciences/swedlow/
> Open Microscopy Environment: http://openmicroscopy.org
> **************************
>
> The University of Dundee is a Scottish Registered Charity, No.
> SC015096.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20090422/64c33f40/attachment.html>
More information about the ome-users
mailing list