[ome-users] Deleting an ROI

Paul Kibet Korir pkorir at ebi.ac.uk
Thu Jan 21 11:47:12 GMT 2016


Hi Mark,

I've tried the code below but it doesn't work.

     conn = BlitzGateway(host=HOST, username=USER, passwd=PASSWORD, 
port=PORT)
     conn.connect()
     updateService = conn.getUpdateService()

     # get the image by Id
     imageId = 2
     image = conn.getObject("Image", imageId)

     roiService = conn.getRoiService()
     result = roiService.findByImage(imageId, None)

     obj_ids = list()
     for roi in result.rois:
          obj_ids.append(roi.getId().getValue())

     print obj_ids
     print len(obj_ids)
     print
     handle = conn.deleteObjects(
         "Roi",
         obj_ids,
         deleteAnns=True,
         deleteChildren=True
         )


     conn._closeSession()

What could I be doing wrong?

P

On 21/01/2016 11:25, Mark Carroll wrote:
> On 01/21/2016 11:10 AM, Paul Kibet Korir wrote:
>
>> Could someone please outline the correct way of deleting an ROI
>> programmatically?
>
> Does
> https://www.openmicroscopy.org/site/support/omero5.2/developers/Python.html#delete-data 
>
> help? For the conn.deleteObjects arguments one ought to be able to write
> "Roi" instead of "Project" and supply the IDs of the ROIs. The default
> behavior is, if a Roi is deleted, its Shape objects are automatically
> deleted along with it.
>
> -- Mark
>
> The University of Dundee is a registered Scottish Charity, No: SC015096
> _______________________________________________
> ome-users mailing list
> ome-users at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users

-- 
With kind regards,

*Paul K Korir, PhD*
/Scientific Programmer/
EMBL-EBI
Main Building, A2-35,
WTGC, Hinxton, Cambridge CB10 1SD
P: +44 1223 49 44 22
F: +44 1223 49 44 68
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-users/attachments/20160121/c3a33788/attachment.html>


More information about the ome-users mailing list