Created
June 11, 2020 17:44
-
-
Save nikitinvv/6e54e32d40575b90219a1da8180f7cf8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tomopy as tp | |
import numpy as np | |
import time | |
#timing functions | |
def tic(): | |
global startTime_for_tictoc | |
startTime_for_tictoc = time.time() | |
def toc(): | |
if 'startTime_for_tictoc' in globals(): | |
return time.time() - startTime_for_tictoc | |
# projections sizes [Ntheta,Nz,N] | |
Nz = 2048 | |
N = 2448 | |
Ntheta = 1500 | |
# init some data | |
proj = np.ones([Ntheta,Nz,N],dtype='float32') | |
# init angles | |
theta = np.linspace(0,np.pi,Ntheta,endpoint=False).astype('float32') | |
# rotation center | |
rot_center = N/2 | |
tic() | |
rec = tp.recon(proj, theta, center = N/2, sinogram_order = False, algorithm = 'gridrec', filter_name = 'hann') | |
print('Time for reconstruction:', toc()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment