src/save_rois.py
def save_rois(image, regions, scale, replace):
    '''
    Main entry point - given a (BlitzGateway-based) omero image, regions and a scaling factor (that should be the same used for ROI creation),
    saves the regions as ROIs in OMERO

    Parameters:
                    image (OMERO image): return of a BlitzGateway.getObject() call, where ROIs will be saved to
                    regions (list): list of tuples of the form (y1,x1,y2,x2) representing the ROIs to be saved
                    scale (int? I guess it could be float...): scaling factor that will be applied to the regions (should be the same as the
                    one used when creating the ROIs)
                    replace(bool): whether to delete ALL existing ROIs from the image before saving the newly created ones or not. Use when rerunning 
                    the code on the same image.
    
                                    
    '''


    if replace:
        remove_all_rois(image)
    if regions and image:
        conn = image._conn
        counter = 1
        for region in regions:
            bbox = region
            
            shape = create_rectangle(bbox, counter, scale)
            if shape is not None:
                roi = create_roi(conn, image, [shape])
            counter = counter + 1
            
    else:
        return None

    Main entry point - given a (BlitzGateway-based) omero image, regions and a scaling factor (that should be the same used for ROI creation),
    saves the regions as ROIs in OMERO

    Parameters:
                    image (OMERO image): return of a BlitzGateway.getObject() call, where ROIs will be saved to
                    regions (list): list of tuples of the form (y1,x1,y2,x2) representing the ROIs to be saved
                    scale (int? I guess it could be float...): scaling factor that will be applied to the regions (should be the same as the
                    one used when creating the ROIs)
                    replace(bool): whether to delete ALL existing ROIs from the image before saving the newly created ones or not. Use when rerunning 
                    the code on the same image.
    
                                    
    
Main entry point - given a (BlitzGateway-based) omero image, regions and a scaling factor (that should be the same used for ROI creation),
saves the regions as ROIs in OMERO

image (OMERO image): return of a BlitzGateway.getObject() call, where ROIs will be saved to
regions (list): list of tuples of the form (y1,x1,y2,x2) representing the ROIs to be saved
scale (int. I guess it could be float...): scaling factor that will be applied to the regions (should be the same as the
one used when creating the ROIs)
replace(bool): whether to delete ALL existing ROIs from the image before saving the newly created ones or not. Use when rerunning
the code on the same image.
Main entry point - given a ( BlitzGateway - based ) omero image regions and a scaling factor ( that should be the same used for ROI creation ) saves the regions as ROIs in OMERO image ( OMERO image ) : return of a BlitzGateway . getObject () call where ROIs will be saved to regions ( list ) : list of tuples of the form ( y1 x1 y2 x2 ) representing the ROIs to be saved scale ( int . I guess it could be float ... ) : scaling factor that will be applied to the regions ( should be the same as the one used when creating the ROIs ) replace ( bool ) : whether to delete ALL existing ROIs from the image before saving the newly created ones or not . Use when rerunning the code on the same image .
def save_rois(image, regions, scale, replace):
    if replace:
        remove_all_rois(image)
    if regions and image:
        conn = image._conn
        counter = 1
        for region in regions:
            bbox = region
            shape = create_rectangle(bbox, counter, scale)
            if shape is not None:
                roi = create_roi(conn, image, [shape])
            counter = counter + 1
    else:
        return None
def save_rois ( image , regions , scale , replace ) : if replace : remove_all_rois ( image ) if regions and image : conn = image . _conn counter = 1 for region in regions : bbox = region shape = create_rectangle ( bbox , counter , scale ) if shape is not None : roi = create_roi ( conn , image , [ shape ] ) counter = counter + 1 else : return None
Main entry point - given a (BlitzGateway-based) omero image, regions and a scaling factor (that should be the same used for ROI creation),
saves the regions as ROIs in OMERO
Main entry point - given a ( BlitzGateway - based ) omero image regions and a scaling factor ( that should be the same used for ROI creation ) saves the regions as ROIs in OMERO
'''
    Main entry point - given a (BlitzGateway-based) omero image, regions and a scaling factor (that should be the same used for ROI creation),
    saves the regions as ROIs in OMERO

    Parameters:
                    image (OMERO image): return of a BlitzGateway.getObject() call, where ROIs will be saved to
                    regions (list): list of tuples of the form (y1,x1,y2,x2) representing the ROIs to be saved
                    scale (int? I guess it could be float...): scaling factor that will be applied to the regions (should be the same as the
                    one used when creating the ROIs)
                    replace(bool): whether to delete ALL existing ROIs from the image before saving the newly created ones or not. Use when rerunning 
                    the code on the same image.
    
                                    
    '''
image
regions
scale
replace