We're Hiring!

Navigating back to Image

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Navigating back to Image

Postby johnjhufnagle » Tue Apr 27, 2010 7:00 pm

Hi,

What would be the code snippet for a piece of OMERO server-side code (custom bridge helper) to retrieve the set of Images that have been annotated by a given CommentAnnotation.

So for example if my custom bridge helper's set() method has been called what is the code & 'hql' to retrieve the list of Images that are annotated by this CommentAnnotation?

Thanks
John
johnjhufnagle
 
Posts: 34
Joined: Tue Dec 15, 2009 8:50 pm

Re: Navigating back to Image

Postby jmoore » Thu Apr 29, 2010 2:52 pm

Hi John,

In 4.1, annotations are unidirectional and therefore it's not possibly to navigate from annotations to the annotated objects (Images, Datasets, ...). With a (significantly) more complicated bridge configuration, it would be possible to get access to the Hibernate session and perform a query of the form:
Code: Select all
select i from Image i join i.annotationLinks links join links.child annotation where annotation.id = 5


Working from images will keep your bridge simpler and more robust. There is the question of how to guarantee that annotated images are passed to the bridge in a timely manner. If you don't see in the logs the images being passed to the indexer along with the annotations, your options include:

* a cron job
* a database trigger
* modifying the objects in code (e.g. incrementing their version number)

A ticket exists for this problem with annotations. See http://trac.openmicroscopy.org.uk/omero/ticket/1390

Cheers,
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany


Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 0 guests