当前位置: 首页>>代码示例>>Python>>正文


Python DVIDNodeService.put_labels3D方法代码示例

本文整理汇总了Python中libdvid.DVIDNodeService.put_labels3D方法的典型用法代码示例。如果您正苦于以下问题:Python DVIDNodeService.put_labels3D方法的具体用法?Python DVIDNodeService.put_labels3D怎么用?Python DVIDNodeService.put_labels3D使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在libdvid.DVIDNodeService的用法示例。


在下文中一共展示了DVIDNodeService.put_labels3D方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_labels_3d_volsync

# 需要导入模块: from libdvid import DVIDNodeService [as 别名]
# 或者: from libdvid.DVIDNodeService import put_labels3D [as 别名]
 def test_labels_3d_volsync(self):
     node_service = DVIDNodeService(TEST_DVID_SERVER, self.uuid)
     node_service.create_labelblk("test_labels_3d2", "test_labels_3d2_vol")
     data = numpy.random.randint(0, 2**63-1, (128,128,128)).astype(numpy.uint64)
     node_service.put_labels3D( "test_labels_3d2", data, (0,0,0) )
     retrieved_data = node_service.get_labels3D( "test_labels_3d2", (30,30,30), (20,20,20) )
     self.assertTrue( (retrieved_data == data[20:50, 20:50, 20:50]).all() )
开发者ID:gnayuy,项目名称:libdvid-cpp,代码行数:9,代码来源:test_node_service.py

示例2: test_labels_3d

# 需要导入模块: from libdvid import DVIDNodeService [as 别名]
# 或者: from libdvid.DVIDNodeService import put_labels3D [as 别名]
 def test_labels_3d(self):
     node_service = DVIDNodeService(TEST_DVID_SERVER, self.uuid)
     node_service.create_labelblk("test_labels_3d")
     data = numpy.random.randint(0, 2**63-1, (128,128,128)).astype(numpy.uint64)
     assert data.flags['C_CONTIGUOUS']
     node_service.put_labels3D( "test_labels_3d", data, (0,0,0) )
     retrieved_data = node_service.get_labels3D( "test_labels_3d", (30,31,32), (20,20,20) )
     self.assertTrue( (retrieved_data == data[20:50, 20:51, 20:52]).all() )
开发者ID:podgorskiy,项目名称:libdvid-cpp,代码行数:10,代码来源:test_node_service.py

示例3: put_labels

# 需要导入模块: from libdvid import DVIDNodeService [as 别名]
# 或者: from libdvid.DVIDNodeService import put_labels3D [as 别名]
 def put_labels():
     node_service = DVIDNodeService(str(server), str(uuid))
     # send data from roi start position
     node_service.put_labels3D(
         str(label_name),
         seg,
         (subvolume.roi.x1, subvolume.roi.y1, subvolume.roi.z1),
         compress=True,
         roi=str(roi_name),
         mutate=mutate,
     )
开发者ID:stuarteberg,项目名称:DVIDSparkServices,代码行数:13,代码来源:sparkdvid.py

示例4: test_labels_3d

# 需要导入模块: from libdvid import DVIDNodeService [as 别名]
# 或者: from libdvid.DVIDNodeService import put_labels3D [as 别名]
    def test_labels_3d(self):
        node_service = DVIDNodeService(TEST_DVID_SERVER, self.uuid, "[email protected]", "test_label_app")
        node_service.create_labelblk("test_labels_3d")
        lblksize = node_service.get_blocksize("test_labels_3d")

        self.assertEqual(32, lblksize)
        
        
        node_service.create_labelblk("test_labels_3d64", "", 64)
        lblksize64 = node_service.get_blocksize("test_labels_3d64")
        self.assertEqual(64, lblksize64)
       
        data = numpy.random.randint(0, 2**63-1, (128,128,128)).astype(numpy.uint64)
        assert data.flags['C_CONTIGUOUS']
        node_service.put_labels3D( "test_labels_3d", data, (0,0,0) )
        retrieved_data = node_service.get_labels3D( "test_labels_3d", (30,31,32), (20,20,20) )
        self.assertTrue( (retrieved_data == data[20:50, 20:51, 20:52]).all() )
开发者ID:janelia-flyem,项目名称:libdvid-cpp,代码行数:19,代码来源:test_node_service.py

示例5: DVIDNodeService

# 需要导入模块: from libdvid import DVIDNodeService [as 别名]
# 或者: from libdvid.DVIDNodeService import put_labels3D [as 别名]
    logging.info('UUID:\n{}'.format(uuid))

    # get node service
    node_service = DVIDNodeService(server_address, uuid)

    # get dataset size and store in dvid
    shape = image_provider.getImageShape(args.ilpFilename, args.labelImagePath)
    time_range = image_provider.getTimeRange(args.ilpFilename, args.labelImagePath)
    if args.timeRange is not None:
        time_range = (max(time_range[0], args.timeRange[0]), min(time_range[1], args.timeRange[1]))
    logging.info('Uploading time range {} to {}'.format(time_range, server_address))
    keyvalue_store = "config"
    node_service.create_keyvalue(keyvalue_store)
    settings = { "shape": shape, "time_range": time_range }
    node_service.put(keyvalue_store, "imageInfo", json.dumps(settings))

    # upload all frames
    for frame in range(time_range[0], time_range[1]):
        logging.info("Uploading frame {}".format(frame))
        label_image = image_provider.getLabelImageForFrame(args.ilpFilename, args.labelImagePath, frame)
        raw_image = image_provider.getImageDataAtTimeFrame(args.rawFilename, args.rawPath, frame)

        raw_name = "raw-{}".format(frame)
        seg_name = "seg-{}".format(frame)
        node_service.create_grayscale8(raw_name)
        node_service.put_gray3D(raw_name, dataToBlock(raw_image, dtype=np.uint8), (0,0,0))
        node_service.create_labelblk(seg_name)
        node_service.put_labels3D(seg_name, dataToBlock(label_image, dtype=np.uint64), (0,0,0))

    # TODO: upload classifier
开发者ID:JaimeIvanCervantes,项目名称:hytra,代码行数:32,代码来源:upload_dataset.py


注:本文中的libdvid.DVIDNodeService.put_labels3D方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。