We're Hiring!

Searching for orphan images using OMEROPy

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.

Searching for orphan images using OMEROPy

Postby icaoberg » Tue May 28, 2013 2:42 pm

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?
icaoberg
 
Posts: 145
Joined: Fri Sep 17, 2010 9:05 pm
Location: Pittsburgh, PA

Re: Searching for orphan images using OMEROPy

Postby atarkowska » Wed May 29, 2013 9:19 am

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
atarkowska
 
Posts: 327
Joined: Mon May 18, 2009 12:44 pm

Re: Searching for orphan images using OMEROPy

Postby wmoore » Thu May 30, 2013 8:40 am

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?
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm

Re: Searching for orphan images using OMEROPy

Postby icaoberg » Thu Aug 29, 2013 9:08 pm

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?
icaoberg
 
Posts: 145
Joined: Fri Sep 17, 2010 9:05 pm
Location: Pittsburgh, PA

Re: Searching for orphan images using OMEROPy

Postby atarkowska » Fri Aug 30, 2013 10:54 am

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
atarkowska
 
Posts: 327
Joined: Mon May 18, 2009 12:44 pm


Return to Developer Discussion

Who is online

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