示例#1
0
 def rmatvec(x):
     y = fa.fitsarray_from_header(cube_header)
     y[:] = 0
     for i in xrange(ng):
         xi = x[..., i::ng]
         xi.header = xi.header[i::ng]
         backprojector4d(xi, y, **kwargs)
     del xi
     return y
示例#2
0
 def rmatvec(x):
     y = fa.fitsarray_from_header(cube_header)
     y[:] = 0
     backprojector4d(x, y, obstacle=obstacle)
     return y
示例#3
0
obj[:] = siddon.phantom.shepp_logan(obj.shape)
# number of images
n = 20
# reshape object for 4d model
obj4 = obj.reshape(obj.shape + (1,)).repeat(n, axis=-1)
obj4.header.update('NAXIS', 4)
obj4.header.update('NAXIS4', obj4.shape[3])
obj4.header.update('CRVAL4', 0.)

# data 
image_header = {'n_images':n,
                'SIMPLE':True, 'BITPIX':-64,
                'NAXIS1':128, 'NAXIS2':128,
                'CRPIX1':64, 'CRPIX2':64,
                'CDELT1':6e-5, 'CDELT2':6e-5,
                'CRVAL1':0., 'CRVAL2':0.,
                }
image_header['radius'] = 200.
data = siddon.simu.circular_trajectory_data(**image_header)
data[:] = np.zeros(data.shape)
# projection
t = time.time()
data = siddon.projector4d(data, obj4)
print("projection time : " + str(time.time() - t))
# backprojection
x0 = obj4.copy()
x0[:] = 0.
t = time.time()
x0 = siddon.backprojector4d(data, x0)
print("backprojection time : " + str(time.time() - t))