本文整理汇总了Python中omero_sys_ParametersI.ParametersI.addId方法的典型用法代码示例。如果您正苦于以下问题:Python ParametersI.addId方法的具体用法?Python ParametersI.addId怎么用?Python ParametersI.addId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类omero_sys_ParametersI.ParametersI
的用法示例。
在下文中一共展示了ParametersI.addId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: rint
# 需要导入模块: from omero_sys_ParametersI import ParametersI [as 别名]
# 或者: from omero_sys_ParametersI.ParametersI import addId [as 别名]
c = omero.client()
s = c.createSession()
q = s.getQueryService()
GET_IMAGES_WITH_PLATES = "select i from Image i join i.wellSamples ws join ws.well w" " join w.plate p" # Inner joins
GET_PLATE_FROM_IMAGE_ID = (
"select p from Plate p join p.wells w join w.wellSamples ws" " join ws.image i where i.id = :id"
)
filter = omero.sys.Filter()
filter.limit = rint(100)
filter.offset = rint(0)
params = ParametersI()
params.theFilter = filter
images = q.findAllByQuery(GET_IMAGES_WITH_PLATES, params)
print "Found %s images" % len(images)
for image in images:
params = ParametersI()
params.addId(image.getId().getValue())
# Multiple plates per image will through an exception
plate = q.findByQuery(GET_PLATE_FROM_IMAGE_ID, params)
print "Image %s belongs to Plate %s (%s)" % (
image.getId().getValue(),
plate.getId().getValue(),
plate.getName().getValue(),
)
示例2: ParametersI
# 需要导入模块: from omero_sys_ParametersI import ParametersI [as 别名]
# 或者: from omero_sys_ParametersI.ParametersI import addId [as 别名]
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import omero
from omero.rtypes import *
from omero_sys_ParametersI import ParametersI
client = omero.client(sys.argv)
try:
sf = client.createSession()
q = sf.getQueryService()
query_string = "select i from Image i where i.id = :id and name like :namedParameter";
p = ParametersI()
p.addId(1L)
p.add("namedParameter", rstring("cell%mit%"));
results = q.findAllByQuery(query_string, p)
finally:
client.closeSession()
示例3: range
# 需要导入模块: from omero_sys_ParametersI import ParametersI [as 别名]
# 或者: from omero_sys_ParametersI.ParametersI import addId [as 别名]
from omero_sys_ParametersI import ParametersI # Temporary
c = omero.client();
s = c.createSession();
q = s.getQueryService();
QUERY = 'select p from Plate p left outer join fetch p.wells w left outer join fetch w.wellSamples s left outer join fetch s.image where p.id = :id';
filter = omero.sys.Filter();
plates = q.findAll('Plate', filter);
print 'Plate:'
for i in range(len(plates)):
params = ParametersI();
params.addId(plates[i].getId().getValue());
plate = q.findByQuery(QUERY, params);
print ' %d %s ' % ( i, plate.getName().getValue() )
wells = {}
for well in plate.copyWells():
row = well.getRow() and well.getRow().getValue() or -1
col = well.getColumn() and well.getColumn().getValue() or -1
if row in wells:
row_list = wells[row];
else:
row_list = []
wells[row] = row_list;
row_list.append(col);
row_list.sort()
示例4: testAddIdRType
# 需要导入模块: from omero_sys_ParametersI import ParametersI [as 别名]
# 或者: from omero_sys_ParametersI.ParametersI import addId [as 别名]
def testAddIdRType(self):
p = ParametersI()
p.addId(rlong(1))
assert rlong(1) == p.map["id"]
示例5: testAddIdRaw
# 需要导入模块: from omero_sys_ParametersI import ParametersI [as 别名]
# 或者: from omero_sys_ParametersI.ParametersI import addId [as 别名]
def testAddIdRaw(self):
p = ParametersI()
p.addId(1)
assert rlong(1) == p.map["id"]
示例6: rint
# 需要导入模块: from omero_sys_ParametersI import ParametersI [as 别名]
# 或者: from omero_sys_ParametersI.ParametersI import addId [as 别名]
filter.offset = rint(0)
plates = q.findAll("Plate", filter)
if len(plates) == 0:
print "No plates"
sys.exit(0)
else:
import random
example_plate = random.choice(plates)
print "Loading wells for Plate %s (%s)" % (example_plate.getId().getValue(), example_plate.getName().getValue())
# An example of true paging
filter.limit = rint(12)
params = ParametersI()
params.addId(example_plate.getId().getValue())
params.theFilter = filter
offset = 0
while True:
wells = q.findAllByQuery(LOAD_WELLS, params)
if len(wells) == 0:
break
else:
offset += len(wells)
params.theFilter.offset = rint( offset )
for well in wells:
id = well.getId().getValue()
row = well.getRow().getValue()
示例7: testAddIdRType
# 需要导入模块: from omero_sys_ParametersI import ParametersI [as 别名]
# 或者: from omero_sys_ParametersI.ParametersI import addId [as 别名]
def testAddIdRType(self):
p = ParametersI()
p.addId(rlong(1))
self.assertEquals(rlong(1), p.map["id"])