We're Hiring!

how to "Connect to my buddy’s data"

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.

how to "Connect to my buddy’s data"

Postby yuriy_alexandrov » Mon Apr 29, 2013 12:13 pm

Hi All,

Our FLIMfit program is Matalb-based OMERO client currently working with data in the User scope.

I wonder if there is possibility to “load and annotate” the data of any other User form any of the groups to which current User belongs?
Other words, to have “Connect to my buddy’s data” option.

As it looks from some of the examples posted previously - that needs Administrator logon and then changing “security contexts”.

How practical is that, what are the steps, possible examples, and also if maybe there are some shortcuts?

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

Re: how to "Connect to my buddy’s data"

Postby sbesson » Tue Apr 30, 2013 8:35 pm

Hi Yuriy

Reading and annotating objects from other users's in my group may not require you to be administrator, e.g. in a read-annotate group (see the permissions tables).

Can you give me a more concrete example of what you are trying to achieve? Are you trying to load images only or projects/datasets/screens/plates as well?

Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: how to "Connect to my buddy’s data"

Postby yuriy_alexandrov » Wed May 01, 2013 10:31 am

Thanks Sebastien,

In the highest Omero scope, we keep client, session and "working data", - that might be Dataset or Plate, and its parent data for convenience - Project or Screen.

We load images for analysis from that Dataset or Plate.

Everything is chosen from the data of the current user - here is excerpt from "select_Dataset" function:

Code: Select all
            param = omero.sys.ParametersI();
            param.leaves();
            %           
            userId = session.getAdminService().getEventContext().userId;
            param.exp(omero.rtypes.rlong(userId));
            projectsList = proxy.loadContainerHierarchy('omero.model.Project', [], param);
            alldatasetsList = proxy.loadContainerHierarchy('omero.model.Dataset', [], param);
            %etc..

Annotations might be imported/exported to/from Datasets or Plates of that current user, too.

What I would like to do - ideally is to somehow "switch logon" to another user without knowing password, to work with his/her data instead.

I can guess that the "session" should be switched, or maybe one can solve it by adding the set of corresponding objects for "another_user"?
...
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: how to "Connect to my buddy’s data"

Postby sbesson » Wed May 01, 2013 9:48 pm

Hi Yuriy,

barring any permission issue (private group), you should be able to access other user's data within the context of the original session using the experimenter parameters:

Code: Select all
param = omero.sys.ParametersI();
param.leaves();

userId = session.getAdminService().getEventContext().userId;
param.exp(omero.rtypes.rlong(userId));
myProjectsList = proxy.loadContainerHierarchy('omero.model.Project', [], param);

param.exp(omero.rtypes.rlong(otherId));
otherProjectsList = proxy.loadContainerHierarchy('omero.model.Project', [], param);


You can also load all projects of all users for the current group by passing -1:

Code: Select all
param = omero.sys.ParametersI();
param.leaves();
           
param.exp(omero.rtypes.rlong(-1));
allProjectsList = proxy.loadContainerHierarchy('omero.model.Project', [], param);


If using OMERO.matlab 4.4.7 or greater, you can set this using the owner parameter/value pair:

Code: Select all
myProjects = getProjects(session);
otherProjects = getProjects(session, 'owner', otherId);
allProjects  = getProjects(session, 'owner', -1);


Note the all the examples above only return objects within the context of the current session group. To retrieve projects from another group, you need to switch the session context:

Code: Select all
session.setSecurityContext(newgroup);
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: how to "Connect to my buddy’s data"

Postby yuriy_alexandrov » Fri May 03, 2013 12:59 pm

Many thanks Sebastien, looks very helpful.. will try to use it soon..

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


Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest