src/save_rois.py
def create_rectangle(data, order, scale):
    '''
    Generate shape from bounding box data and scaling factor.
                                    
    '''
    from omero.model import RectangleI
    # assuming 2d image
    z_index = 0
    t_index = 0

    # scale up to full-size image
    y1 = data[0] * scale
    x1 = data[1] * scale
    h = (data[2] - data[0]) * scale
    w = (data[3] - data[1]) * scale
    shape = RectangleI()
    
    shape.x = rdouble(x1)
    shape.y = rdouble(y1)
    shape.width = rdouble(w)
    shape.height = rdouble(h)
    
    shape.textValue = rstring("ROI "+str(order))
     

    if shape is not None:
        shape.theZ = rint(z_index)
        shape.theT = rint(t_index)
    return shape

    Generate shape from bounding box data and scaling factor.
                                    
    
Generate shape from bounding box data and scaling factor.
Generate shape from bounding box data and scaling factor .
def create_rectangle(data, order, scale):
    from omero.model import RectangleI
    z_index = 0
    t_index = 0
    y1 = data[0] * scale
    x1 = data[1] * scale
    h = (data[2] - data[0]) * scale
    w = (data[3] - data[1]) * scale
    shape = RectangleI()
    shape.x = rdouble(x1)
    shape.y = rdouble(y1)
    shape.width = rdouble(w)
    shape.height = rdouble(h)
    shape.textValue = rstring("ROI "+str(order))
    if shape is not None:
        shape.theZ = rint(z_index)
        shape.theT = rint(t_index)
    return shape
def create_rectangle ( data , order , scale ) : from omero . model import RectangleI z_index = 0 t_index = 0 y1 = data [ 0 ] * scale x1 = data [ 1 ] * scale h = ( data [ 2 ] - data [ 0 ] ) * scale w = ( data [ 3 ] - data [ 1 ] ) * scale shape = RectangleI ( ) shape . x = rdouble ( x1 ) shape . y = rdouble ( y1 ) shape . width = rdouble ( w ) shape . height = rdouble ( h ) shape . textValue = rstring ( "ROI " + str ( order ) ) if shape is not None : shape . theZ = rint ( z_index ) shape . theT = rint ( t_index ) return shape
Generate shape from bounding box data and scaling factor.
Generate shape from bounding box data and scaling factor .
'''
    Generate shape from bounding box data and scaling factor.
                                    
    ''' # assuming 2d image # scale up to full-size image
data
order
scale