本文整理汇总了Python中omero.gateway.BlitzGateway.getMetadataService方法的典型用法代码示例。如果您正苦于以下问题:Python BlitzGateway.getMetadataService方法的具体用法?Python BlitzGateway.getMetadataService怎么用?Python BlitzGateway.getMetadataService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类omero.gateway.BlitzGateway
的用法示例。
在下文中一共展示了BlitzGateway.getMetadataService方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: open
# 需要导入模块: from omero.gateway import BlitzGateway [as 别名]
# 或者: from omero.gateway.BlitzGateway import getMetadataService [as 别名]
file_path = os.path.join(path, ann.getFile().getName())
f = open(str(file_path), 'w')
print "\nDownloading file to", file_path, "..."
try:
for chunk in ann.getFileInChunks():
f.write(chunk)
finally:
f.close()
print "File downloaded!"
# Load all the file annotations with a given namespace
# ====================================================
nsToInclude = [namespace]
nsToExclude = []
metadataService = conn.getMetadataService()
annotations = metadataService.loadSpecifiedAnnotations(
'omero.model.FileAnnotation', nsToInclude, nsToExclude, None)
for ann in annotations:
print ann.getId().getValue(), ann.file.name.val
# Get first annotation with specified namespace
# =============================================
ann = dataset.getAnnotation(namespace)
print "Found Annotation with namespace: ", ann.getNs()
# Close connection
# ================
# When you are done, close the session to free up server resources.