本文整理汇总了Python中libdvid.DVIDNodeService.get_typeinfo方法的典型用法代码示例。如果您正苦于以下问题:Python DVIDNodeService.get_typeinfo方法的具体用法?Python DVIDNodeService.get_typeinfo怎么用?Python DVIDNodeService.get_typeinfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libdvid.DVIDNodeService
的用法示例。
在下文中一共展示了DVIDNodeService.get_typeinfo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_blocksize
# 需要导入模块: from libdvid import DVIDNodeService [as 别名]
# 或者: from libdvid.DVIDNodeService import get_typeinfo [as 别名]
def get_blocksize(dvid_server, uuid, dataname):
"""Gets block size for supplied data name.
Note:
Does not check for existence of body and whether
it is an array type. The block size is always
assumes to be isotropic.
Args:
dvid_server (str): location of dvid server
uuid (str): version id
dataname (str): data instance
Returns:
(z,y,x) blocksize.
Raises:
DVIDExceptions are not caught in this function and will be
transferred to the caller.
"""
ns = DVIDNodeService(str(dvid_server), str(uuid))
info = ns.get_typeinfo(dataname)
x,y,z = info["Extended"]["BlockSize"] # DVID ordered x,y,z
return (z,y,x)
示例2: copy_roi
# 需要导入模块: from libdvid import DVIDNodeService [as 别名]
# 或者: from libdvid.DVIDNodeService import get_typeinfo [as 别名]
def copy_roi( src_info, dest_info ):
src_service = DVIDNodeService(src_info.server, src_info.uuid)
dest_service = DVIDNodeService(dest_info.server, dest_info.uuid)
# If necessary, create the ROI on the destination server
try:
info = dest_service.get_typeinfo(dest_info.name)
except DVIDException:
dest_service.create_roi(dest_info.name)
roi_blocks = src_service.get_roi(src_info.name)
dest_service.post_roi(dest_info.name, roi_blocks)
示例3: is_datainstance
# 需要导入模块: from libdvid import DVIDNodeService [as 别名]
# 或者: from libdvid.DVIDNodeService import get_typeinfo [as 别名]
def is_datainstance(dvid_server, uuid, name):
"""Checks if datainstance name exists.
Args:
dvid_server (str): location of dvid server
uuid (str): version id
name (str): data instance name
"""
try:
ns = DVIDNodeService(str(dvid_server), str(uuid))
info = ns.get_typeinfo(name)
except DVIDException:
# returns exception if it does not exist
return False
return True
示例4: __init__
# 需要导入模块: from libdvid import DVIDNodeService [as 别名]
# 或者: from libdvid.DVIDNodeService import get_typeinfo [as 别名]
def __init__(self, dvidserver, uuid, dataname):
"""Initialization.
Args:
dvidserver (string): address for dvid server
uuid (string): uuid for DVID instance
dataname (string): name of data instance
"""
self.server = dvidserver
self.uuid = uuid
self.name = dataname
# check DVID existence and get meta
try:
node_service = DVIDNodeService(str(dvidserver), str(uuid))
self.info = node_service.get_typeinfo(dataname)
except DVIDException:
raise ValueError("Instance not available")
self.datatype = str(self.info["Base"]["TypeName"])
示例5: has_sync
# 需要导入模块: from libdvid import DVIDNodeService [as 别名]
# 或者: from libdvid.DVIDNodeService import get_typeinfo [as 别名]
def has_sync(dvid_server, uuid, srcname, destname):
"""Checks whether srcname is synced (listen to changes) on destname.
Args:
dvid_server (str): location of dvid server
uuid (str): version id
srcname (str): data instance with the potential sync
destname (str): data instance pointed to by the sync
Returns:
A boolean of value True if the sync exists.
Raises:
DVIDExceptions are not caught in this function and will be
transferred to the caller.
"""
ns = DVIDNodeService(str(dvid_server), str(uuid))
info = ns.get_typeinfo(srcname)
sync_data = info["Base"]["Syncs"]
return destname in sync_data