def ellipse():
    o = EllipseI()
    populate_shape(o)
    o.cx = rdouble(1.0)
    o.cy = rdouble(2.0)
    o.rx = rdouble(3.0)
    o.ry = rdouble(4.0)
    o.id = rlong(1L)
    return o
Exemplo n.º 2
0
def ellipse():
    o = EllipseI()
    populate_shape(o)
    o.cx = rdouble(1.0)
    o.cy = rdouble(2.0)
    o.rx = rdouble(3.0)
    o.ry = rdouble(4.0)
    o.id = rlong(1L)
    return o
def ellipse_with_annotations():
    o = EllipseI()
    populate_shape(o)
    add_annotations(o)
    o.cx = rdouble(1.0)
    o.cy = rdouble(2.0)
    o.rx = rdouble(3.0)
    o.ry = rdouble(4.0)
    o.id = rlong(1L)
    return o
Exemplo n.º 4
0
def ellipse_with_annotations():
    o = EllipseI()
    populate_shape(o)
    add_annotations(o)
    o.cx = rdouble(1.0)
    o.cy = rdouble(2.0)
    o.rx = rdouble(3.0)
    o.ry = rdouble(4.0)
    o.id = rlong(1L)
    return o
Exemplo n.º 5
0
def ellipse():
    o = EllipseI()
    populate_shape(o)
    if SCHEMA_VERSION == "2015-01":
        o.cx = rdouble(1.0)
        o.cy = rdouble(2.0)
        o.rx = rdouble(3.0)
        o.ry = rdouble(4.0)
    else:
        o.x = rdouble(1.0)
        o.y = rdouble(2.0)
        o.radiusX = rdouble(3.0)
        o.radiusY = rdouble(4.0)
    o.id = rlong(1L)
    return o
Exemplo n.º 6
0
def ellipse():
    o = EllipseI()
    populate_shape(o)
    if SCHEMA_VERSION == '2015-01':
        o.cx = rdouble(1.0)
        o.cy = rdouble(2.0)
        o.rx = rdouble(3.0)
        o.ry = rdouble(4.0)
    else:
        o.x = rdouble(1.0)
        o.y = rdouble(2.0)
        o.radiusX = rdouble(3.0)
        o.radiusY = rdouble(4.0)
    o.id = rlong(1L)
    return o
Exemplo n.º 7
0
 def _parse_neo_roi(self, columns):
     """Parses out ROI from OmeroTables columns for 'NEO' datasets."""
     log.debug("Parsing %s NEO ROIs..." % (len(columns[0].values)))
     image_ids = columns[self.IMAGE_COL].values
     rois = list()
     # Save our file annotation to the database so we can use an unloaded
     # annotation for the saveAndReturnIds that will be triggered below.
     self.file_annotation = \
         self.update_service.saveAndReturnObject(self.file_annotation)
     unloaded_file_annotation = \
         FileAnnotationI(self.file_annotation.id.val, False)
     batch_no = 1
     batches = dict()
     for i, image_id in enumerate(image_ids):
         unloaded_image = ImageI(image_id, False)
         roi = RoiI()
         shape = EllipseI()
         values = columns[6].values
         diameter = rdouble(float(values[i]))
         shape.theZ = rint(0)
         shape.theT = rint(0)
         values = columns[4].values
         shape.cx = rdouble(float(values[i]))
         values = columns[3].values
         shape.cy = rdouble(float(values[i]))
         shape.rx = diameter
         shape.ry = diameter
         roi.addShape(shape)
         roi.image = unloaded_image
         roi.linkAnnotation(unloaded_file_annotation)
         rois.append(roi)
         if len(rois) == self.ROI_UPDATE_LIMIT:
             self.thread_pool.add_task(
                 self.update_rois, rois, batches, batch_no)
             rois = list()
             batch_no += 1
     self.thread_pool.add_task(self.update_rois, rois, batches, batch_no)
     self.thread_pool.wait_completion()
     batch_keys = batches.keys()
     batch_keys.sort()
     for k in batch_keys:
         columns[self.ROI_COL].values += batches[k]