Esempio n. 1
0
    DetectorsDimV=
    None,  # DetectorsDimV # detector dimension (vertical) for 3D case only
    CenterRotOffset=None,  # Center of Rotation (CoR) scalar (for 3D case only)
    AnglesVec=angles_rad,  # array of angles in radians
    ObjSize=N_size,  # a scalar to define reconstructed object dimensions
    datafidelity=
    'LS',  # data fidelity, choose LS, PWLS (wip), GH (wip), Student (wip)
    device_projector='gpu')
#%%
print("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
print("Reconstructing analytical sinogram using SIRT (tomobar)...")
print("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
# prepare dictionaries with parameters:
_data_ = {'projection_norm_data': sino_an}  # data dictionary
_algorithm_ = {'iterations': 250}
SIRTrec_ideal = RectoolsIR.SIRT(_data_, _algorithm_)  # ideal reconstruction
_data_ = {'projection_norm_data': noisy_zing_stripe}  # data dictionary
SIRTrec_error = RectoolsIR.SIRT(_data_, _algorithm_)  # error reconstruction

plt.figure()
plt.subplot(121)
plt.imshow(SIRTrec_ideal, vmin=0, vmax=1, cmap="gray")
plt.colorbar(ticks=[0, 0.5, 1], orientation='vertical')
plt.title('Ideal SIRT reconstruction (ASTRA)')
plt.subplot(122)
plt.imshow(SIRTrec_error, vmin=0, vmax=3, cmap="gray")
plt.colorbar(ticks=[0, 0.5, 1], orientation='vertical')
plt.title('Erroneous data SIRT Reconstruction (ASTRA)')
plt.show()

plt.figure()
Esempio n. 2
0
    CenterRotOffset=None,  # Center of Rotation (CoR) scalar (for 3D case only)
    AnglesVec=angles_rad,  # array of angles in radians
    ObjSize=N_size,  # a scalar to define reconstructed object dimensions
    datafidelity=
    'LS',  # data fidelity, choose LS, PWLS (wip), GH (wip), Student (wip)
    nonnegativity='ENABLE',  # enable nonnegativity constraint (set to 'ENABLE')
    OS_number=
    None,  # the number of subsets, NONE/(or > 1) ~ classical / ordered subsets
    tolerance=1e-06,  # tolerance to stop outer iterations earlier
    device='gpu')
#%%
print("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
print("Reconstructing analytical sinogram using SIRT (tomobar)...")
print("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
iterationsSIRT = 250
SIRTrec_ideal = RectoolsIR.SIRT(sino_an,
                                iterationsSIRT)  # ideal reconstruction
SIRTrec_error = RectoolsIR.SIRT(noisy_zing_stripe,
                                iterationsSIRT)  # error reconstruction

plt.figure()
plt.subplot(121)
plt.imshow(SIRTrec_ideal, vmin=0, vmax=1, cmap="gray")
plt.colorbar(ticks=[0, 0.5, 1], orientation='vertical')
plt.title('Ideal SIRT reconstruction (ASTRA)')
plt.subplot(122)
plt.imshow(SIRTrec_error, vmin=0, vmax=1, cmap="gray")
plt.colorbar(ticks=[0, 0.5, 1], orientation='vertical')
plt.title('Erroneous data SIRT Reconstruction (ASTRA)')
plt.show()

plt.figure()
Esempio n. 3
0
    DetectorsDimV=
    None,  # DetectorsDimV # detector dimension (vertical) for 3D case only
    CenterRotOffset=None,  # Center of Rotation (CoR) scalar (for 3D case only)
    AnglesVec=angles_rad,  # array of angles in radians
    ObjSize=N_size,  # a scalar to define reconstructed object dimensions
    datafidelity=
    'LS',  # data fidelity, choose LS, PWLS (wip), GH (wip), Student (wip)
    device_projector='gpu')
#%%
print("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
print("Reconstructing analytical sinogram using SIRT (tomobar)...")
print("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
# prepare dictionaries with parameters:
_data_ = {'projection_norm_data': noisy_sino}  # data dictionary
_algorithm_ = {'iterations': 250}
SIRTrec = RectoolsIR.SIRT(_data_, _algorithm_)  # ideal reconstruction

plt.figure()
plt.imshow(SIRTrec, vmin=0, vmax=1, cmap="gray")
plt.colorbar(ticks=[0, 0.5, 1], orientation='vertical')
plt.title('SIRT Reconstruction')
plt.show()
#%%
print("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
print("Reconstructing using FISTA method (tomobar)")
print("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
# prepare dictionaries with parameters:
_data_ = {'projection_norm_data': noisy_sino}  # data dictionary
lc = RectoolsIR.powermethod(
    _data_)  # calculate Lipschitz constant (run once to initialise)
_algorithm_ = {'iterations': 350, 'lipschitz_const': lc}