def test_project(): N=100 x=modified_shepp_logan((N,N,3))[:,:,1] x=numpy.array(x) rp=ref.project(x) ip=opencl.project(x) assert is_equal(rp,ip)
def test_project(): N=50 x=modified_shepp_logan((N,N,3))[:,:,1] x=numpy.array(x) rp=ref.project(x) op=ocv.project(x) assert is_equal(rp,op)
def test_project(): N=50 x=modified_shepp_logan((N,N,3))[:,:,1] x=numpy.array(x) rp=ref.project(x) ip=ispmd.project(x) # import pylab # pylab.figure() # pylab.subplot(211) # pylab.plot(rp) # pylab.subplot(212) # pylab.plot(ip) # pylab.show() assert is_equal(rp,ip)
def bencmark_backprojection(sizes): bencmark_res={} counts=10 functions={'ocv.back_project':ocv.back_project, 'ispmd.back_project':ispmd.back_project, 'ref.back_project':ref.back_project} for size in sizes: x=phantom.modified_shepp_logan((size,size,3))[:,:,1] x=ref.project(x) for func_name in functions: func=functions[func_name] t=time.time() for c in range(counts): y=func(x) btime=(time.time()-t)/counts if not func_name in bencmark_res: bencmark_res[func_name]=[] bencmark_res[func_name].append({'size':size,'time':btime}) return bencmark_res