示例#1
0
from vigra import blockwise as bw




numpy.random.seed(42)

# input
shape = (500, 500, 500)

data = numpy.random.rand(*shape).astype('float32')

print "make options object"
options = bw.BlockwiseConvolutionOptions3D()
print type(options)

sigma = 1.0
options.stdDev = (sigma, )*3
options.blockShape = (128, )*3

print "stddev",options.stdDev
print "call blockwise filter"

with vigra.Timer("AllThread"):
	res = bw.gaussianSmooth(data, options)
with vigra.Timer("1thread"):
	resRef = vigra.gaussianSmoothing(data, sigma)


print numpy.sum(numpy.abs(res-resRef))
示例#2
0
文件: blocking.py 项目: paragt/vigra
import vigra
from vigra import graphs
from vigra import numpy
from vigra import Timer
from vigra import blockwise as bw

numpy.random.seed(42)

# input
shape = (500, 500, 500)

data = numpy.random.rand(*shape).astype('float32')

print "make options object"
options = bw.BlockwiseConvolutionOptions3D()
print type(options)

sigma = 1.0
options.stdDev = (sigma, ) * 3
options.blockShape = (128, ) * 3

print "stddev", options.stdDev
print "call blockwise filter"

with vigra.Timer("AllThread"):
    res = bw.gaussianSmooth(data, options)
with vigra.Timer("1thread"):
    resRef = vigra.gaussianSmoothing(data, sigma)

print numpy.sum(numpy.abs(res - resRef))
示例#3
0
文件: test3.py 项目: jfhci/vigra
def checkAboutSame(i1,i2):
    assert(i1.shape==i2.shape)
    difference=np.sum(np.abs(i1-i2))/float(np.size(i1))
    assert(difference<5)
示例#4
0
文件: test3.py 项目: jfhci/vigra
def checkImages(i1,i2):
    assert(i1.shape==i2.shape)
    assert(np.sum(i1==i2)!=0)
示例#5
0
def checkAboutSame(i1,i2):
    checkShape(i1.shape, i2.shape)
    difference=np.sum(np.abs(i1-i2))/float(np.size(i1))
    assert(difference<5)
示例#6
0
def checkImages(i1,i2):
    checkShape(i1.shape, i2.shape)
    assert(np.sum(i1==i2)!=0)