We're Hiring!

XML annotations - visualizing & search

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.

XML annotations - visualizing & search

Postby yuriy_alexandrov » Tue Oct 21, 2014 3:45 pm

Hi All,

I noticed that 5.0.5+ Omero.Insight and Webclient don't display any XML annotations other than Modulo.
That is pity - as such quick assessment of custom metadata is very handy.

Also there is question on search inside XML annotation, say to get Value by Key, etc. - is there any tools that would look for tags, etc? I presume not, but if something else is known on this topic, it would be nice to know.

Thanks,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: XML annotations - visualizing & search

Postby jburel » Wed Oct 22, 2014 10:01 am

Hi Yuriy

The XML Annotations should be displayed on the right-hand side under "others"
If this is not the case, this is a bug than we will have to fix.
You will have to write your own parser, we not have a build-in parser for any XML annotation.
For modulo, we do know what to expect so we can extract for example the start and end values, the step so we can correctly visualise the image.
What are you trying to achieve? Do you add extra metadata in this xml file?

Cheers
Jmarie
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee

Re: XML annotations - visualizing & search

Postby wmoore » Wed Oct 22, 2014 10:29 am

Hi Yuriy,

If you want to be able to do specific Lucene key/value searches on a custom data structure, you can add a search bridge to tell Lucene how to index the XML.
https://www.openmicroscopy.org/site/sup ... idges.html

There's a lot on the forums about this from user 'bhcho', since they wrote a parser for OMERO.editor xml files:
E.g.
viewtopic.php?f=6&t=553
viewtopic.php?f=6&t=934&p=3408
and you can find more by searching forums!
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm

Re: XML annotations - visualizing & search

Postby yuriy_alexandrov » Wed Oct 22, 2014 1:32 pm

Thanks Will, Jmarie,

Yes for OPT data, we add additional metadata as XML annotations.

For our files (OME.tiffs), one can use Bio-Formats Viewer to examine these metadata, but when image is uploaded to Omero, it's different.

Webclient and Omero.Insight (5.0.5) show the Modulo if it is there, but no additional XML Annotations from "StructuredAnnotation" block. Yes it looks like the bug.

So I think something like Bio-Formats Viewer would be useful in Webclient and Omero.Insight, or (presumably simpler) option - just to fix it to see StructuredAnnotations.

On search - in Insight's "Search" chapter, there is "Annotations" option - very impressive, but as I saw, limited by "FileAnnotation" only.
If one could extend it for "XMLAnnotation" type, - that would be very useful, too.

Best,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: XML annotations - visualizing & search

Postby jburel » Thu Oct 23, 2014 8:32 am

Hi Yuriy

Could you send us a sample file so we can investigate the issue?

Thanks

Jmarie
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee

Re: XML annotations - visualizing & search

Postby jburel » Thu Oct 23, 2014 10:32 am

Thanks Yuriy for the file

Jmarie
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee

Re: XML annotations - visualizing & search

Postby yuriy_alexandrov » Thu Oct 23, 2014 10:41 am

Thanks Jmarie,

I've sent the file to Your (dundee.ac.uk) e-mail.

There is another related question that appeared just today - we would like to add TagAnnotations to these OME.tiffs, as well.

I can create TagAnnotation as

Code: Select all
tag  = ome.xml.model.TagAnnotation();

but not sure how to set value and incorporate it into the metadata.

In the case of "modulo", it was

Code: Select all
    modulo = loci.formats.CoreMetadata();
...
    OMEXMLService = loci.formats.services.OMEXMLServiceImpl();
    OMEXMLService.addModuloAlong(metadata, modulo, 0);
...

Is it worth opening another (hopefully not long :) ) thread on that?

Best,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: XML annotations - visualizing & search

Postby jburel » Sun Oct 26, 2014 9:31 pm

Discussion about TagAnnotation moved to viewtopic.php?f=13&t=7661
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee

Re: XML annotations - visualizing & search

Postby jburel » Mon Oct 27, 2014 12:02 pm

Hi Yuriy

I had a look at the file you sent me.
Only the XML modulo annotation is linked to the image, the other ones aren't.
You will need to add the annotation ref in order to link the annotations to the image.
That will explain why the annotations are not displayed.

Cheers
Jmarie
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee

Re: XML annotations - visualizing & search

Postby yuriy_alexandrov » Mon Oct 27, 2014 2:47 pm

Thanks Jmarie,

Most likely, I should use this -

Code: Select all
setXMLAnnotationAnnotationRef
public void setXMLAnnotationAnnotationRef(String annotation,
                                 int XMLAnnotationIndex,
                                 int annotationRefIndex)

First 2 parameters I can deduce form previous usage, but on the third one, not sure.
Is it OK just to put 0 there? or the same XMLAnnotationIndex?
[update - tried both neither works]

Other words, - what is the difference between XMLAnnotationIndex and XMLAnnotationRefIndex?
(This is single-image case.. for now).

TagAnnotations also aren't visible, could it be because of the same reason - could setTagAnnotationRef help?

Last thing I did - I also put these custom XMLs into Image Description - this way, it becomes visible in Insight/Omeroweb viewers, but still not searchable..
Certainly if XMLAnnotation worked I wouldn't even try.. but maybe good to know just for the case (there is no setImageDescriptionRef method)..

Best regards, thanks again,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Next

Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 1 guest