Page 1 of 1

Searching for orphan images using OMEROPy

PostPosted: Tue May 28, 2013 2:42 pm
by icaoberg
I imported some images to omero using the importer cli. When I did so, I didn't assign them to a dataset.

I am trying to find a way to get the list of images associated with me. Since I cannot get a list of projects and then a list of datasets -it is an empty omero server that i am testing-, I am wondering what is the appropriate method in the API to get the list of all images directly?

Re: Searching for orphan images using OMEROPy

PostPosted: Wed May 29, 2013 9:19 am
by atarkowska
Hi,

All interaction with the OMERO server takes place via several API services available from a ServiceFactory. Here is a list of available language bindings.

From your post I understand that you would prefer to use Python language in order to write a script. The best place to start with that is to look onto Python Gateway.
Sample code could look like as the following:
Code: Select all
conn = BlitzGateway(USERNAME, PASSWORD, host=HOST, port=PORT)
connected = conn.connect()
params = omero.sys.ParametersI()
params.exp(conn.getUser().getId())  # only show current user's Image
images = conn.getObjects("Image", params=params)
for obj in images:
    print """%s:%s  Name:"%s" (owner=%s)""" % (\
                obj.OMERO_CLASS,\
                obj.getId(),\
                obj.getName(),\
                obj.getOwnerOmeName())


Ola

Re: Searching for orphan images using OMEROPy

PostPosted: Thu May 30, 2013 8:40 am
by wmoore
We actually add a conn.listOrphans() method to the webclient gateway, if you want to get ONLY the orphaned Images.

https://github.com/openmicroscopy/openm ... ay.py#L414

Ola - maybe we should consider moving this to the main Blitz Gateway?

Re: Searching for orphan images using OMEROPy

PostPosted: Thu Aug 29, 2013 9:08 pm
by icaoberg
will this method list the orphan images associated with the user+connection OR will it list all visible orphan images associated with the user+connection?

Re: Searching for orphan images using OMEROPy

PostPosted: Fri Aug 30, 2013 10:54 am
by atarkowska
Hi,
Implementation was pushed to BlitzGateway in this commit.

Answering your questions, by default it returns only images owned by connected user. But you should be able to specify parameters what exactly you want to return. Please try using
Code: Select all
params = omero.sys.ParametersI()


Thanks
Ola