src/save_rois.py
def create_roi(conn, img, shapes):

    '''
    Generic function to save ROI(s) to OMERO using updateService    
                                    
    '''
    from omero.model import RoiI
    updateService = conn.getUpdateService()
    roi = RoiI()
    
    roi.setImage(img._obj)
    # I could be calling this function just once by creating a list of shapes beforehand, but whatever
    for shape in shapes:
        roi.addShape(shape)
    # setting group is always necessary here - using same group as the image's 
    group_id = img.getDetails().getGroup().getId()
    ctx = {'omero.group': str(group_id)}
    return updateService.saveAndReturnObject(roi, ctx)

    Generic function to save ROI(s) to OMERO using updateService    
                                    
    
Generic function to save ROI(s) to OMERO using updateService
Generic function to save ROI ( s ) to OMERO using updateService
def create_roi(conn, img, shapes):
    from omero.model import RoiI
    updateService = conn.getUpdateService()
    roi = RoiI()
    roi.setImage(img._obj)
    for shape in shapes:
        roi.addShape(shape)
    group_id = img.getDetails().getGroup().getId()
    ctx = {'omero.group': str(group_id)}
    return updateService.saveAndReturnObject(roi, ctx)
def create_roi ( conn , img , shapes ) : from omero . model import RoiI updateService = conn . getUpdateService ( ) roi = RoiI ( ) roi . setImage ( img . _obj ) for shape in shapes : roi . addShape ( shape ) group_id = img . getDetails ( ) . getGroup ( ) . getId ( ) ctx = { 'omero.group' : str ( group_id ) } return updateService . saveAndReturnObject ( roi , ctx )
Generic function to save ROI(s) to OMERO using updateService
Generic function to save ROI ( s ) to OMERO using updateService
'''
    Generic function to save ROI(s) to OMERO using updateService    
                                    
    ''' # I could be calling this function just once by creating a list of shapes beforehand, but whatever # setting group is always necessary here - using same group as the image's 
conn
img
shapes