# angles number angles = np.linspace(0.0, 179.9, angles_num, dtype='float32') # in degrees angles_rad = angles * (np.pi / 180.0) #%% # initialise TomoRec DIRECT reconstruction class ONCE from tomorec.methodsDIR import RecToolsDIR RectoolsDIR = RecToolsDIR( DetectorsDimH=Horiz_det, # DetectorsDimH # detector dimension (horizontal) DetectorsDimV= Vert_det, # DetectorsDimV # detector dimension (vertical) for 3D case only AnglesVec=angles_rad, # array of angles in radians ObjSize=N_size, # a scalar to define reconstructed object dimensions device='gpu') #%% print("Building 3D analytical projection data with TomoPhantom") projData3D_analyt = TomoP3D.ModelSino(model, N_size, Horiz_det, Vert_det, angles, path_library3D) intens_max = 70 sliceSel = 150 plt.figure() plt.subplot(131) plt.imshow(projData3D_analyt[:, sliceSel, :], vmin=0, vmax=intens_max) plt.title('2D Projection (analytical)') plt.subplot(132) plt.imshow(projData3D_analyt[sliceSel, :, :], vmin=0, vmax=intens_max) plt.title('Sinogram view') plt.subplot(133) plt.imshow(projData3D_analyt[:, :, sliceSel], vmin=0, vmax=intens_max) plt.title('Tangentogram view') plt.show() #%%
plt.show() # ## Analytical Projection Data at different angles # In[4]: angles = np.arange(0, 2 * np.pi, np.pi / 6, dtype="float32") # in radian angles_deg = np.arange(0, 360, 30, dtype="float32") # in degree #-------------------------------------- det_row = 400 ## horizontal detector size det_col = 400 ## vertical detector size #-------------------------------------- projData = TomoP3D.ModelSino(model, N_size, det_col, det_row, angles_deg, path_library3D) #-------------------------------------- intens_max = 100 plt.figure(figsize=[10, 20]) plt.subplot(131) plt.imshow(projData[:, 0, :], vmin=10, vmax=intens_max) plt.title('2D Projection (analytical)') plt.subplot(132) plt.imshow(projData[slice_, :, :], vmin=10, vmax=intens_max, aspect="auto") plt.title('Sinogram view') plt.subplot(133) plt.imshow(projData[:, :, slice_], vmin=10, vmax=intens_max, aspect="auto") plt.title('Tangentogram view') plt.show()