コード例 #1
0
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy
import requests
import time

#DVID Data fetch:
dvid = DVIDRemote({
    "protocol": "http",
    "host": "localhost:8000",
})

UUID = "5cc94d532799484cb01788fcdb7cd9f0"

#Getting information on the UUID
info = dvid.get_info(UUID)
print(info)

# Demonstration of obtaining and updating the log
log = dvid.get_log(UUID)
print(log)
logP = dvid.post_log(UUID, "This repository contains images used for testing2")
log = dvid.get_log(UUID)
print(log)

#Gets 3d volume data
volumeD = dvid.get_cutout(
    dvid.get_channel("5cc94d532799484cb01788fcdb7cd9f0", "grayscale"),
    [2300, 4600], [2300, 4600], [1380, 1390])
print(volumeD)
コード例 #2
0
ファイル: general_test.py プロジェクト: jhuapl-boss/intern
)

chan_actual_parent1 = dvid.create_project(instance_setup_merge)
print("\nParent1 UUID: " + chan_actual_parent1)
commit_1 = dvid.commit(chan_actual_parent1, note="Test the commit")
branch_1 = dvid.branch(chan_actual_parent1,
                       note="Test the versioning system once")

branch_2 = dvid.branch(chan_actual_parent1,
                       note="Test the versioning system twice")

print("Created branches {} and {} from Parent1".format(branch_1, branch_2))

########### Test Metadat API ###########
# Set up a new project with a channel
print(dvid.get_info(instance_setup_merge))
print(dvid.get_server_info())
print(dvid.get_server_compiled_types())
dvid.server_reload_metadata()

########### Test Voluming API ###########
#

# Prepare the data
img = Image.open("<somedir>/*.png")
data_tile = np.asarray(img)
print(data_tile.shape)
data_tile = np.expand_dims(data_tile, axis=0)
data_tile = data_tile.copy(order="C")

# Create the project