[ome-devel] Get list of Tags in Matlab
Sebastien Besson (Staff)
s.besson at dundee.ac.uk
Fri Jan 8 14:50:50 GMT 2016
Hi Christophe,
the best way to retrieve all tags in a given context is likely to write a query to
retrieve all TagAnnotations (optionally belonging to an user).
Python examples of such queries exist in the CLI tag plugin [1] or in the Webclient
gateway [2]. From MATLAB you should be able to use IQuery.projection and then
unwrap the returned results.
>> context = java.util.HashMap;
>> context.put('omero.group', java.lang.String(num2str(groupId)));
>> tagQuery = ‘select t.id, t.textValue from TagAnnotation t’;
>> results = toMatlabList(session.getQueryService.projection(tagQuery, [], context))
Best,
Sebastien
[1] https://github.com/openmicroscopy/openmicroscopy/blob/v5.2.1/components/tools/OmeroPy/src/omero/plugins/tag.py#L253
[2] https://github.com/openmicroscopy/openmicroscopy/blob/v5.2.1/components/tools/OmeroWeb/omeroweb/webclient/webclient_gateway.py#L380
[3] http://downloads.openmicroscopy.org/omero/5.2.1/api/ome/api/IQuery.html#projection-java.lang.String-ome.parameters.Parameters-<http://downloads.openmicroscopy.org/omero/5.2.1/api/ome/logic/QueryImpl.html#projection-java.lang.String-ome.parameters.Parameters->
On 7 Jan 2016, at 16:30, Christophe TREFOIS <christophe.trefois at uni.lu<mailto:christophe.trefois at uni.lu>> wrote:
Hi Will,
The idea was to get all tags belonging to a user or a group, perhaps even better for a group.
It makes sense to get all Tags, since I don’t want duplicate tags for dataset / images and so on. Or what is the reason that these even exist?
We inspired ourselves from omero.webtagging source code which uses HQL, but I thought there could be a cleaner way.
Thanks,
Dr Christophe Trefois, Dipl.-Ing.
Technical Specialist / Post-Doc
UNIVERSITÉ DU LUXEMBOURG
LUXEMBOURG CENTRE FOR SYSTEMS BIOMEDICINE
Campus Belval | House of Biomedicine
6, avenue du Swing
L-4367 Belvaux
T: +352 46 66 44 6124
F: +352 46 66 44 6949
http://www.uni.lu/lcsb
[Facebook]<https://www.facebook.com/trefex> [Twitter] <https://twitter.com/Trefex> [Google Plus] <https://plus.google.com/+ChristopheTrefois/> [Linkedin] <https://www.linkedin.com/in/trefoischristophe> [skype] <http://skype:Trefex?call>
----
This message is confidential and may contain privileged information.
It is intended for the named recipient only.
If you receive it in error please notify me and permanently delete the original message and any copies.
----
On 07 Jan 2016, at 16:46, William Moore <will at lifesci.dundee.ac.uk<mailto:will at lifesci.dundee.ac.uk>> wrote:
Hi Michael & Christophe,
I thought Christophe was trying to get ALL tags (not tags on an Image etc).
>From what I can see, the metadata service gives you tags attached to objects?
Christophe, perhaps you can clarify what criteria you want to load Tags by?
Just get ALL tags in the system? Belonging to a particular user? With a particular namespace or value?
Cheers,
Will.
On 7 Jan 2016, at 15:10, "Michael Porter (Staff)" <m.porter at dundee.ac.uk<mailto:m.porter at dundee.ac.uk>> wrote:
Hi Christophe
I’m not 100% sure, since I’ve never used it for this, but if you want to get a tags in a user/system centric way rather than an image-centric way, you need to get the metadataService from the session object (http://www.openmicroscopy.org/site/support/omero5.2/developers/Modules/Api.html ) . I think from here you can use the loadAnnotations method (http://downloads.openmicroscopy.org/omero/5.2.1/api/ome/api/IMetadata.html#loadAnnotations-java.lang.Class-java.util.Set-java.util.Set-java.util.Set-ome.parameters.Parameters-)
Michael.
From: ome-devel [mailto:ome-devel-bounces at lists.openmicroscopy.org.uk<mailto:devel-bounces at lists.openmicroscopy.org.uk>] On Behalf Of Christophe TREFOIS
Sent: 07 January 2016 13:38
To: OME External Developer List <ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>>
Subject: [ome-devel] Get list of Tags in Matlab
Hi all,
I have been trying to get a list of all tags using MATLAB and OMERO 5, and I’m sort of struggling.
I saw that Will posted some code for Python on the mailing a while back, but those functions are not available in Matlab.
Does anybody have any pointers how to do this without looping over all images?
Kind regards,
—
Christophe
Dr Christophe Trefois, Dipl.-Ing.
Technical Specialist / Post-Doc
UNIVERSITÉ DU LUXEMBOURG
LUXEMBOURG CENTRE FOR SYSTEMS BIOMEDICINE
Campus Belval | House of Biomedicine
6, avenue du Swing
L-4367 Belvaux
T: +352 46 66 44 6124
F: +352 46 66 44 6949
http://www.uni.lu/lcsb
<https://www.facebook.com/trefex> <https://twitter.com/Trefex> <https://plus.google.com/+ChristopheTrefois/> <https://www.linkedin.com/in/trefoischristophe> <http://skype:Trefex?call>
----
This message is confidential and may contain privileged information.
It is intended for the named recipient only.
If you receive it in error please notify me and permanently delete the original message and any copies.
----
The University of Dundee is a registered Scottish Charity, No: SC015096 <~WRD000.jpg>_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
_______________________________________________
ome-devel mailing list
ome-devel at lists.openmicroscopy.org.uk<mailto:ome-devel at lists.openmicroscopy.org.uk>
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
The University of Dundee is a registered Scottish Charity, No: SC015096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20160108/cc6e2320/attachment.html>
More information about the ome-devel
mailing list