[ome-devel] OMERO: load annotations of projects and datasets

Tom Kazimiers tom at voodoo-arts.net
Tue Jun 5 15:14:14 BST 2012


Hi all,

I am trying to write a small OMERO client which allows some custom
filtering and data display. Therefore I try to get the annotations of
an OMERO object. To do so I followed the examples for OmeroJava.
However I can't seem to manage to retrieve the annotations of
projects and datasets. For now, I am using Jython with OmeroJava and
this is what I am doing:

--->8----

param = ParametersI()
param.exp( rtypes.rlong(userId) )
#param.leaves() # makes no difference for annotation loading

projects = proxy.loadContainerHierarchy( Project.canonicalName, ArrayList(), param)
for r in projects:
	if not r.annotationLinksLoaded:
		print("Annotations are not loaded")
	for a in r.linkedAnnotationList():
		print(a)

--->8----

I always get the "Annotations are not loaded" output followed by
this exception (raised in r.linkedAnnotationList()):

    omero.UnloadedCollectionException: omero.UnloadedCollectionException: Error updating collection:annotationLinksSeq
    Collection is currently null. This can be seen
    by testing "annotationLinksSeqLoaded". This implies
    that this collection was unloaded. Please refresh this object
    in order to update this collection.

What can I do about this? It seems that I need to load the
annotations (which makes sense in a client/server architecture), but
can't seem to find the right part of the documentation.

On data sets I have a similar problem. I have the following loop:

--->8----

for r in projects:
	project = ProjectData( r )
	datasets = project.getDatasets()
	print( "Project name: " + project.getName() + ", description: " + project.getDescription() )
	for ds in datasets:
		print( "\tDataset: " + ds.getName() )
		annotations = ds.getAnnotations()
		if annotations is None:
			print( "\t\t(No annotations)" )
		else:
			for a in annotations:
				print( a )

--->8----

There I don't get the exception like in the project, but I always
get the "(No annotations)" output. However, there actually are
annotations to the dataset. If I use Insight to look at the dataset,
I can see and edit them. Therefore, I think I miss some loading here
as well.

Could some point me in the right direction, please?

Thanks in advance,
Tom

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20120605/99e91310/attachment.pgp>


More information about the ome-devel mailing list