def test_blockwise(): shape = [1000, 1000, 400] blockShape = [100, 100, 100] totalData = numpy.random.rand(*shape).astype(numpy.float32) print "blockwiseGaussianSmoothing" result = blockwise_filters.blockwiseGaussianSmoothing(totalData,1.0,nThreads=12,blockShape=blockShape) for x in range(20): blockwise_filters.blockwiseGaussianGradientMagnitude(totalData,1.0,nThreads=12,blockShape=blockShape)
def test_blockwise(): shape = [1000, 1000, 400] blockShape = [100, 100, 100] totalData = numpy.random.rand(*shape).astype(numpy.float32) print "blockwiseGaussianSmoothing" result = blockwise_filters.blockwiseGaussianSmoothing( totalData, 1.0, nThreads=12, blockShape=blockShape) for x in range(20): blockwise_filters.blockwiseGaussianGradientMagnitude( totalData, 1.0, nThreads=12, blockShape=blockShape)
import sys import vigra from time import time path = "/home/tbeier/Desktop/data.h5" shape = [1000, 100, 1000] data = numpy.random.rand(*shape).astype(numpy.float32) shape = data.shape print shape blockShape = [100, 100, 100] print "blockwiseGaussianGradientMagnitude" t0 = time() result = blockwise_filters.blockwiseGaussianGradientMagnitude( data, 5.0, nThreads=22, blockShape=blockShape) t1 = time() print "done in", t1 - t0 tp = t0 - t1 print "blockwiseGaussianGradientMagnitude" t0 = time() result = vigra.filters.gaussianGradientMagnitude(data, 5.0) t1 = time() print "done in", t1 - t0 ts = t0 - t1 print ts / tp
def __call__(self): result = blockF.blockwiseGaussianGradientMagnitude(self.raw, sigma=self.sigma) return result
path = "/home/tbeier/Desktop/data.h5" shape = [1000, 100, 1000] data=numpy.random.rand(*shape).astype(numpy.float32) shape = data.shape print shape blockShape = [100, 100, 100] print "blockwiseGaussianGradientMagnitude" t0=time() result = blockwise_filters.blockwiseGaussianGradientMagnitude(data, 5.0, nThreads=22, blockShape=blockShape) t1=time() print "done in",t1-t0 tp = t0-t1 print "blockwiseGaussianGradientMagnitude" t0=time() result = vigra.filters.gaussianGradientMagnitude(data, 5.0) t1=time() print "done in",t1-t0 ts = t0-t1 print ts/tp