We're Hiring!

fileset deletion with python bindings

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.

fileset deletion with python bindings

Postby evenhuis » Fri Jun 08, 2018 5:44 am

Hi all,

I recently had a user accidentally upload a 100 FoV image three times into a an existing dataset. They couldn't delete a single image as it is part of a fileset. In they In principle they could have deleted the fileset themselves by multiply selecting the 100 images that make up the fileset, but this wasn't practical.

I found the id of the fileset through the python bindings, but I couldn't find a way to delete it, either in the documents or by inspecting the member methods of fileset and connection objects. I was able to delete it using the omero commandline line tool.

It is possible to delete a fileset through the python binding? It would be nice be able to do this through python as I find it much more convenient for interactively exploration.

Cheers,

Chris
evenhuis
 
Posts: 61
Joined: Tue Jan 30, 2018 4:47 am

Re: fileset deletion with python bindings

Postby jmoore » Fri Jun 08, 2018 5:59 am

Hi Chris,

evenhuis wrote:It is possible to delete a fileset through the python binding? It would be nice be able to do this through python as I find it much more convenient for interactively exploration.


Definitely, since this is exactly what the commandline tool is doing with the `omero.cmd.Delete2` argument. But it's even simpler if you use the Gateway wrapper. Based roughly on the Delete.py example:

Code: Select all
import omero
import omero.callbacks
from omero.gateway import BlitzGateway

fid = 31252
conn = BlitzGateway(USERNAME, PASSWORD, host=HOST, port=PORT)
conn.connect()
conn.deleteObjects("Fileset", [fid], wait=True)


Cheers,
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany


Return to Developer Discussion

Who is online

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

cron