本文整理匯總了Python中params.Params.channels方法的典型用法代碼示例。如果您正苦於以下問題:Python Params.channels方法的具體用法?Python Params.channels怎麽用?Python Params.channels使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類params.Params
的用法示例。
在下文中一共展示了Params.channels方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_roi
# 需要導入模塊: from params import Params [as 別名]
# 或者: from params.Params import channels [as 別名]
def test_roi (self):
"""Upload an roi and test it's fields"""
# Make a skeleton
makeAnno (p, 9)
# test the parent
parent = random.randint (0,65535)
f = setField(p, 'parent', parent)
f = getField(p, 'parent')
assert parent == int(f.content)
# make a bunch of children ROIs
q = Params()
q.token = 'unittest'
q.resolution = 0
q.channels = ['unit_anno']
childids = []
for i in range(0,4):
makeAnno ( q, 9)
f = setField(q, 'parent', p.annoid)
childids.append(q.annoid)
# Test children
f = getField(p, 'children')
rchildids = f.content.split(',')
for cid in rchildids:
assert int(cid) in childids
assert len(rchildids) == 4
示例2: test_node
# 需要導入模塊: from params import Params [as 別名]
# 或者: from params.Params import channels [as 別名]
def test_node (self):
"""Upload a skeleton node and test it's fields"""
# Make a node
makeAnno (p, 7)
# test the nodetype
nodetype = random.randint (0,100)
f = setField(p, 'nodetype', nodetype)
f = getField(p, 'nodetype')
assert nodetype == int(f.content)
# test the skeletonid
skeletonid = random.randint (0,65535)
f = setField(p, 'skeletonid', skeletonid)
f = getField(p, 'skeletonid')
assert skeletonid == int(f.content)
# test the pointid
pointid = random.randint (0,65535)
f = setField(p, 'pointid', pointid)
f = getField(p, 'pointid')
assert pointid == int(f.content)
# test the parentid
parentid = random.randint (0,65535)
f = setField(p, 'parentid', parentid)
f = getField(p, 'parentid')
assert parentid == int(f.content)
# test the radius
radius = random.random()
f = setField(p, 'radius', radius)
f = getField(p, 'radius')
assert abs(radius - float(f.content)) < 0.001
# test the location
location = [random.random(), random.random(), random.random()]
f = setField(p, 'location', ','.join([str(i) for i in location]))
f = getField(p, 'location')
assert ','.join([str(i) for i in location]) == f.content
# make a bunch of children
q = Params()
q.token = 'unittest'
q.resolution = 0
q.channels = ['unit_anno']
childids = []
for i in range(0,4):
makeAnno ( q, 9)
f = setField(q, 'parent', p.annoid)
childids.append(q.annoid)
# Test children
f = getField(p, 'children')
rchildids = f.content.split(',')
for cid in rchildids:
assert int(cid) in childids
assert len(rchildids) == 4
示例3: test_neuron
# 需要導入模塊: from params import Params [as 別名]
# 或者: from params.Params import channels [as 別名]
def test_neuron (self):
"""Upload a neuron and test it's fields"""
# Make a neuron
makeAnno (p, 5)
# make a bunch of segments and add to the neuron
q = Params()
q.token = 'unittest'
q.resolution = 0
q.channels = ['unit_anno']
segids = []
for i in range(0,5):
makeAnno ( q, 4)
f = setField(q, 'neuron', p.annoid)
segids.append(q.annoid)
# Test segments
f = getField(p, 'segments')
rsegids = f.content.split(',')
for sid in rsegids:
assert int(sid) in segids
assert len(rsegids) == 5
示例4: Params
# 需要導入模塊: from params import Params [as 別名]
# 或者: from params.Params import channels [as 別名]
import time
import makeunitdb
from ocptype import ANNOTATION, UINT32
from params import Params
from ramon import H5AnnotationFile, setField, getField, queryField, makeAnno, createSpecificSynapse
from postmethods import putAnnotation, getAnnotation, getURL, postURL
import kvengine_to_test
import site_to_test
#from ocpgraph import genGraphRAMON
SITE_HOST = site_to_test.site
p = Params()
p.token = 'unittest'
p.resolution = 0
p.channels = ['ANNO1']
p.channel_type = ANNOTATION
p.datatype = UINT32
class Test_GraphGen:
def setup_class(self):
"""Create the unittest database"""
makeunitdb.createTestDB(p.token, channel_list=p.channels, public=True, readonly=0)
cutout1 = "0/2,5/1,3/0,2"
cutout2 = "0/1,3/4,6/2,5"
cutout3 = "0/4,6/2,5/5,7"
cutout4 = "0/6,8/5,9/2,4"
syn_segments1 = [[7, 3], ]
示例5: Params
# 需要導入模塊: from params import Params [as 別名]
# 或者: from params.Params import channels [as 別名]
import OCP.settings
os.environ['DJANGO_SETTINGS_MODULE'] = 'OCP.settings'
from ocptype import IMAGE, UINT8
from params import Params
from jsonproj import createJson
from postmethods import getURL, postURL, postNPZ, getNPZ
import makeunitdb
import site_to_test
SITE_HOST = site_to_test.site
p = Params()
p.token = 'unittest'
p.resolution = 0
p.channels = ['CHAN1', 'CHAN2']
p.channel_type = IMAGE
p.datatype = UINT8
p.dataset = 'unittest_ds'
class Test_Project_Json():
def setup_class(self):
"""Setup Parameters"""
pass
def teardown_class(self):
"""Teardown Parameters"""
#makeunitdb.deleteTestDB('unittest')
#makeunitdb.deleteTestDB('unittest2')
# calling a different fucntion for project list as django1.9 introduced new weirdness
示例6: Params
# 需要導入模塊: from params import Params [as 別名]
# 或者: from params.Params import channels [as 別名]
import pytest
import httplib
from contextlib import closing
from params import Params
from postmethods import putAnnotation, getAnnotation, getURL, postURL
import kvengine_to_test
import site_to_test
import makeunitdb
SITE_HOST = site_to_test.site
p = Params()
p.token = 'unittest'
p.resolution = 0
p.channels = ['unit_anno']
def H5AnnotationFile ( annotype, annoid, kv=None ):
"""Create an HDF5 file and populate the fields. Return a file object.
This is a support routine for all the RAMON tests."""
# Create an in-memory HDF5 file
tmpfile = tempfile.NamedTemporaryFile()
h5fh = h5py.File ( tmpfile.name )
# Create the top level annotation id namespace
idgrp = h5fh.create_group ( str(annoid) )
# Annotation type
idgrp.create_dataset ( "ANNOTATION_TYPE", (1,), np.uint32, data=annotype )
示例7: Params
# 需要導入模塊: from params import Params [as 別名]
# 或者: from params.Params import channels [as 別名]
import zlib
import cStringIO
import blosc
import time
sys.path += [os.path.abspath('../django/')]
import OCP.settings
os.environ['DJANGO_SETTINGS_MODULE'] = 'ocpblaze.settings'
from ocplib import MortonXYZ
from params import Params
p = Params()
p.token = "blaze"
p.resolution = 0
p.channels = ['image']
p.window = [0,0]
p.channel_type = "image"
p.datatype = "uint32"
SIZE = 1024
ZSIZE = 16
def generateURL(zidx):
"""Run the Benchmark."""
i = zidx
[x,y,z] = MortonXYZ(i)
p.args = (x*SIZE, (x+1)*SIZE, y*SIZE, (y+1)*SIZE, z*ZSIZE, (z+1)*ZSIZE)
image_data = np.ones([1,ZSIZE,SIZE,SIZE], dtype=np.uint32) * random.randint(0,255)
return postBlosc(p, image_data)
示例8: Params
# 需要導入模塊: from params import Params [as 別名]
# 或者: from params.Params import channels [as 別名]
from contextlib import closing
import makeunitdb
from params import Params
from postmethods import postNPZ, getNPZ
import kvengine_to_test
import site_to_test
SITE_HOST = site_to_test.site
from ocptype import UINT8, UINT16, UINT32, ANNOTATION, IMAGE
from OCP import celery_app
p = Params()
p.token = 'unittest'
p.channels = ['testchannel']
p.args = (0,1024,0,1024,1,11)
class Test_Histogram8:
def setup_class(self):
"""Create the unittest database"""
makeunitdb.createTestDB(p.token, p.channels, channel_type=IMAGE, channel_datatype=UINT8, public=True, ximagesize=1024, yimagesize=1024, zimagesize=10, xvoxelres=1.0, yvoxelres=1.0, zvoxelres=10.0, readonly=0)
def teardown_class (self):
"""Destroy the unittest database"""
makeunitdb.deleteTestDB(p.token)
def test_genhistogram (self):
"""Test generating an 8bit histogram"""
示例9: Params
# 需要導入模塊: from params import Params [as 別名]
# 或者: from params.Params import channels [as 別名]
from ocptype import PROPAGATED, NOT_PROPAGATED, UNDER_PROPAGATION, ISOTROPIC, READONLY_TRUE, READONLY_FALSE
from params import Params
import kvengine_to_test
import site_to_test
import makeunitdb
SITE_HOST = site_to_test.site
# Test_Propagate
#
# 1 - test_update_propagate - Test the propagate service set values
p = Params()
p.token = 'unittest'
p.resolution = 0
p.channels = ['chan1']
p.channel_type = "image"
p.datatype = "uint8"
class Test_Image_Zslice_Propagate:
"""Test image propagation"""
def setup_class(self):
"""Create the unittest database"""
makeunitdb.createTestDB(p.token, public=True, channel_list=p.channels, channel_type=p.channel_type, channel_datatype=p.datatype, ximagesize=1000, yimagesize=1000, zimagesize=10)
def teardown_class (self):
"""Destroy the unittest database"""
makeunitdb.deleteTestDB(p.token)
def test_web_propagate(self):
示例10: Params
# 需要導入模塊: from params import Params [as 別名]
# 或者: from params.Params import channels [as 別名]
sys.path += [os.path.abspath("../django")]
import OCP.settings
os.environ["DJANGO_SETTINGS_MODULE"] = "OCP.settings"
from params import Params
from postmethods import getURL, postURL, putAnnotation
import makeunitdb
import site_to_test
SITE_HOST = site_to_test.site
p = Params()
p.token = "unittest"
p.resolution = 0
p.channels = ["unit_anno"]
class Test_Annotation_Json:
def setup_class(self):
"""Setup Parameters"""
makeunitdb.createTestDB(p.token, readonly=0)
def teardown_class(self):
"""Teardown Parameters"""
makeunitdb.deleteTestDB(p.token)
def test_basic_json(self):
"""Test the annotation (RAMON) JSON interface"""
# create hdf5 file and post it
示例11: Params
# 需要導入模塊: from params import Params [as 別名]
# 或者: from params.Params import channels [as 別名]
import random
import numpy as np
import makeunitdb
from ndlib.ndtype import *
from params import Params
from postmethods import *
from test_settings import *
# Test_Blosc
# 1 - test_get_blosc
# 2 - test_post_blosc
p = Params()
p.token = 'unittest'
p.resolution = 0
p.channels = ['IMAGE1', 'IMAGE2']
p.window = [0,500]
p.channel_type = TIMESERIES
p.datatype = UINT8
p.voxel = [4.0,4.0,3.0]
class Test_Blosc:
def setup_class(self):
makeunitdb.createTestDB(p.token, channel_list=p.channels, channel_type=p.channel_type, channel_datatype=p.datatype)
def teardown_class(self):
makeunitdb.deleteTestDB(p.token)
示例12: test_skeleton
# 需要導入模塊: from params import Params [as 別名]
# 或者: from params.Params import channels [as 別名]
def test_skeleton (self):
"""Upload a skeleton and test it's fields"""
# Make a node
makeAnno (p, 8)
# test the nodetype
skeletontype = random.randint (0,100)
f = setField(p, 'skeletontype', skeletontype)
f = getField(p, 'skeletontype')
assert skeletontype == int(f.content)
# test the rootnode
rootnode = random.randint (0,65535)
f = setField(p, 'rootnode', rootnode)
f = getField(p, 'rootnode')
assert rootnode == int(f.content)
# add some nodes to the skeleton and query them
# make a bunch of children cnodes
q = Params()
q.token = 'unittest'
q.resolution = 0
q.channels = ['unit_anno']
r = Params()
r.token = 'unittest'
r.resolution = 0
r.channels = ['unit_anno']
# make a root node
s = Params()
s.token = 'unittest'
s.resolution = 0
s.channels = ['unit_anno']
# make a root node
skelids = []
# make a root node
makeAnno ( q, 7)
setField(p, 'rootnode', q.annoid)
setField(q, 'skeleton', p.annoid)
skelids.append(q.annoid)
# Make 2 children and four grandchildren
for i in range(0,2):
makeAnno ( r, 7)
f = setField(r, 'parent', q.annoid)
f = setField(r, 'skeleton', p.annoid)
skelids.append(r.annoid)
for i in range(0,2):
makeAnno ( s, 7)
f = setField(s, 'parent', r.annoid)
f = setField(s, 'skeleton', p.annoid)
skelids.append(s.annoid)
# Test skeleton
f = getField(p, 'nodes')
rskelids = f.content.split(',')
for sid in rskelids:
assert int(sid) in skelids
assert len(rskelids) == 7
示例13: test_test_segment
# 需要導入模塊: from params import Params [as 別名]
# 或者: from params.Params import channels [as 別名]
def test_test_segment (self):
"""Upload a segment and test it's fields"""
for i in range(1,10):
makeAnno (p, 1)
# Make a segment
makeAnno (p, 4)
# make a bunch of synapses
q = Params()
q.token = 'unittest'
q.resolution = 0
q.channels = ['unit_anno']
synids = []
presynids = []
postsynids = []
for i in range(0,8):
makeAnno ( q, 2)
f = setField(q, 'segments', ','.join([str(p.annoid),str(random.randint(500,1000))]))
# f = setField(q, 'presegments', ','.join([str(p.annoid),str(random.randint(500,1000))]))
f = setField(q, 'presegments', ','.join([str(p.annoid)]))
f = setField(q, 'postsegments', ','.join([str(p.annoid)]))
synids.append(q.annoid)
presynids.append(q.annoid)
postsynids.append(q.annoid)
# make one more segment
makeAnno ( q, 2)
f = setField(q, 'segments', p.annoid)
synids.append(q.annoid)
# Test synapses
f = getField(p, 'synapses')
rsynids = f.content.split(',')
for sid in rsynids:
assert int(sid) in synids
assert len(rsynids) == 9
# Test presynapses
f = getField(p, 'presynapses')
rsynids = f.content.split(',')
for sid in rsynids:
assert int(sid) in presynids
assert len(rsynids) == 8
# Test postsynapses
f = getField(p, 'postsynapses')
rsynids = f.content.split(',')
for sid in rsynids:
assert int(sid) in postsynids
assert len(rsynids) == 8
# make a bunch of organelles
q = Params()
q.token = 'unittest'
q.resolution = 0
q.channels = ['unit_anno']
orgids = []
for i in range(0,8):
makeAnno ( q, 6 )
f = setField(q, 'segment', p.annoid)
orgids.append(q.annoid)
# Test synapses
f = getField(p, 'organelles')
rorgids = f.content.split(',')
for cid in rorgids:
assert int(cid) in orgids
assert len(rorgids) == 8
示例14: Params
# 需要導入模塊: from params import Params [as 別名]
# 或者: from params.Params import channels [as 別名]
# Test_Image_Post
# 1 - test_npz
# 2 - test_npz_incorrect_region
# 3 - test_npz_incorrect_datatype
# 4 - test_hdf5
# 5 - test_hdf5_incorrect_region
# 6 - test_hdf5_incorrect_datatype
# 7 - test_npz_incorrect_channel
# 8 - test_hdf5_incorrect_channel
p = Params()
p.token = 'unittest'
p.resolution = 0
p.channels = ['TIME1', 'TIME2']
p.time = [0,100]
p.channel_type = TIMESERIES
p.datatype = UINT8
p.window = [0,500]
p.voxel = [4.0,4.0,3.0]
#p.args = (3000,3100,4000,4100,500,510)
class Test_Image_Slice:
def setup_class(self):
makeunitdb.createTestDB(p.token, channel_list=p.channels, channel_type=p.channel_type, channel_datatype=p.datatype, time=p.time)