From f21e8f4305f5e771a3780c3c1c44962f75d1e602 Mon Sep 17 00:00:00 2001 From: dkazanc Date: Thu, 21 Mar 2019 13:04:27 +0000 Subject: softwareX demos updated --- demos/SoftwareX_supp/Demo_RealData_Recon_SX.py | 16 ++++++++-------- demos/SoftwareX_supp/Demo_SimulData_ParOptimis_SX.py | 13 ++++++------- demos/SoftwareX_supp/Demo_SimulData_Recon_SX.py | 18 +++++++++--------- demos/SoftwareX_supp/Readme.md | 2 +- 4 files changed, 24 insertions(+), 25 deletions(-) (limited to 'demos') diff --git a/demos/SoftwareX_supp/Demo_RealData_Recon_SX.py b/demos/SoftwareX_supp/Demo_RealData_Recon_SX.py index 5991989..e60af6e 100644 --- a/demos/SoftwareX_supp/Demo_RealData_Recon_SX.py +++ b/demos/SoftwareX_supp/Demo_RealData_Recon_SX.py @@ -8,13 +8,13 @@ proximal splitting algorithms" by Daniil Kazantsev, Edoardo Pasca, Martin J. Tur ____________________________________________________________________________ * Reads real tomographic data (stored at Zenodo) --- https://doi.org/10.5281/zenodo.2578893 -* Reconstructs using TomoRec software +* Reconstructs using ToMoBAR software * Saves reconstructed images ____________________________________________________________________________ >>>>> Dependencies: <<<<< 1. ASTRA toolbox: conda install -c astra-toolbox astra-toolbox -2. TomoRec: conda install -c dkazanc tomorec -or install from https://github.com/dkazanc/TomoRec +2. tomobar: conda install -c dkazanc tomobar +or install from https://github.com/dkazanc/ToMoBAR 3. libtiff if one needs to save tiff images: install pip install libtiff @@ -24,7 +24,7 @@ GPLv3 license (ASTRA toolbox) import numpy as np import matplotlib.pyplot as plt import h5py -from tomorec.supp.suppTools import normaliser +from tomobar.supp.suppTools import normaliser import time # load dendritic projection data @@ -60,7 +60,7 @@ time_label = int(time.time()) print ("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%") print ("%%%%%%%%%%%%Reconstructing with FBP method %%%%%%%%%%%%%%%%%") print ("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%") -from tomorec.methodsDIR import RecToolsDIR +from tomobar.methodsDIR import RecToolsDIR RectoolsDIR = RecToolsDIR(DetectorsDimH = np.size(det_y_crop), # DetectorsDimH # detector dimension (horizontal) DetectorsDimV = 100, # DetectorsDimV # detector dimension (vertical) for 3D case only @@ -100,10 +100,10 @@ for i in range(0,np.size(FBPrec,0)): """ #%% print ("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%") -print ("Reconstructing with ADMM method using TomoRec software") +print ("Reconstructing with ADMM method using tomobar software") print ("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%") -# initialise TomoRec ITERATIVE reconstruction class ONCE -from tomorec.methodsIR import RecToolsIR +# initialise tomobar ITERATIVE reconstruction class ONCE +from tomobar.methodsIR import RecToolsIR RectoolsIR = RecToolsIR(DetectorsDimH = np.size(det_y_crop), # DetectorsDimH # detector dimension (horizontal) DetectorsDimV = 100, # DetectorsDimV # detector dimension (vertical) for 3D case only AnglesVec = angles_rad, # array of angles in radians diff --git a/demos/SoftwareX_supp/Demo_SimulData_ParOptimis_SX.py b/demos/SoftwareX_supp/Demo_SimulData_ParOptimis_SX.py index be99afe..0925cf6 100644 --- a/demos/SoftwareX_supp/Demo_SimulData_ParOptimis_SX.py +++ b/demos/SoftwareX_supp/Demo_SimulData_ParOptimis_SX.py @@ -12,10 +12,9 @@ ____________________________________________________________________________ Demo_SimulData_Recon_SX.py ____________________________________________________________________________ >>>>> Dependencies: <<<<< ->>>>> Dependencies: <<<<< 1. ASTRA toolbox: conda install -c astra-toolbox astra-toolbox -2. TomoRec: conda install -c dkazanc tomorec -or install from https://github.com/dkazanc/TomoRec +2. tomobar: conda install -c dkazanc tomobar +or install from https://github.com/dkazanc/ToMoBAR @author: Daniil Kazantsev, e:mail daniil.kazantsev@diamond.ac.uk GPLv3 license (ASTRA toolbox) @@ -66,10 +65,10 @@ plt.title('Tangentogram view') plt.show() #%% print ("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%") -print ("Reconstructing with ADMM method using TomoRec software") +print ("Reconstructing with ADMM method using tomobar software") print ("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%") -# initialise TomoRec ITERATIVE reconstruction class ONCE -from tomorec.methodsIR import RecToolsIR +# initialise tomobar ITERATIVE reconstruction class ONCE +from tomobar.methodsIR import RecToolsIR RectoolsIR = RecToolsIR(DetectorsDimH = Horiz_det, # DetectorsDimH # detector dimension (horizontal) DetectorsDimV = Vert_det, # DetectorsDimV # detector dimension (vertical) for 3D case only AnglesVec = proj_angles, # array of angles in radians @@ -158,4 +157,4 @@ h5f = h5py.File('Optim_admm_tgv.h5', 'w') h5f.create_dataset('reg_param_tgv_vec', data=reg_param_tgv_vec) h5f.create_dataset('erros_vec_tgv', data=erros_vec_tgv) h5f.close() -#%% \ No newline at end of file +#%% diff --git a/demos/SoftwareX_supp/Demo_SimulData_Recon_SX.py b/demos/SoftwareX_supp/Demo_SimulData_Recon_SX.py index 63f94a7..1d3dc03 100644 --- a/demos/SoftwareX_supp/Demo_SimulData_Recon_SX.py +++ b/demos/SoftwareX_supp/Demo_SimulData_Recon_SX.py @@ -12,8 +12,8 @@ ____________________________________________________________________________ ____________________________________________________________________________ >>>>> Dependencies: <<<<< 1. ASTRA toolbox: conda install -c astra-toolbox astra-toolbox -2. TomoRec: conda install -c dkazanc tomorec -or install from https://github.com/dkazanc/TomoRec +2. ToMoBAR: conda install -c dkazanc tomobar +or install from https://github.com/dkazanc/ToMoBAR @author: Daniil Kazantsev, e:mail daniil.kazantsev@diamond.ac.uk GPLv3 license (ASTRA toolbox) @@ -103,15 +103,15 @@ plt.title('Vertical (Y-Z) view', fontsize=19) plt.show() #plt.savefig('projdata.pdf', format='pdf', dpi=1200) #%% -# initialise TomoRec DIRECT reconstruction class ONCE -from tomorec.methodsDIR import RecToolsDIR +# initialise tomobar DIRECT reconstruction class ONCE +from tomobar.methodsDIR import RecToolsDIR RectoolsDIR = RecToolsDIR(DetectorsDimH = Horiz_det, # DetectorsDimH # detector dimension (horizontal) DetectorsDimV = Vert_det, # DetectorsDimV # detector dimension (vertical) for 3D case only AnglesVec = proj_angles, # array of angles in radians ObjSize = N_size, # a scalar to define reconstructed object dimensions device = 'gpu') #%% -print ("Reconstruction using FBP from TomoRec") +print ("Reconstruction using FBP from tomobar") recFBP= RectoolsDIR.FBP(projdata_norm) # FBP reconstruction #%% x0, y0 = 0, 127 # These are in _pixel_ coordinates!! @@ -152,10 +152,10 @@ ssim_fbp = Qtools.ssim(win2d) print("Mean SSIM for FBP is {}".format(ssim_fbp[0])) #%% print ("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%") -print ("Reconstructing with ADMM method using TomoRec software") +print ("Reconstructing with ADMM method using tomobar software") print ("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%") -# initialise TomoRec ITERATIVE reconstruction class ONCE -from tomorec.methodsIR import RecToolsIR +# initialise tomobar ITERATIVE reconstruction class ONCE +from tomobar.methodsIR import RecToolsIR RectoolsIR = RecToolsIR(DetectorsDimH = Horiz_det, # DetectorsDimH # detector dimension (horizontal) DetectorsDimV = Vert_det, # DetectorsDimV # detector dimension (vertical) for 3D case only AnglesVec = proj_angles, # array of angles in radians @@ -305,4 +305,4 @@ win = np.array([gaussian(11, 1.5)]) win2d = win * (win.T) ssim_admm_tgv = Qtools.ssim(win2d) print("Mean SSIM ADMM-TGV is {}".format(ssim_admm_tgv[0])) -#%% \ No newline at end of file +#%% diff --git a/demos/SoftwareX_supp/Readme.md b/demos/SoftwareX_supp/Readme.md index 54e83f1..a6463a0 100644 --- a/demos/SoftwareX_supp/Readme.md +++ b/demos/SoftwareX_supp/Readme.md @@ -9,7 +9,7 @@ Data is shared at Zenodo [here](https://doi.org/10.5281/zenodo.2578893) ## Dependencies: 1. [ASTRA toolbox](https://github.com/astra-toolbox/astra-toolbox): `conda install -c astra-toolbox astra-toolbox` -2. [TomoRec](https://github.com/dkazanc/TomoRec): `conda install -c dkazanc tomorec` +2. [ToMoBAR](https://github.com/dkazanc/ToMoBAR): `conda install -c dkazanc tomobar` 3. [Tomophantom](https://github.com/dkazanc/TomoPhantom): `conda install tomophantom -c ccpi` ## Files description: -- cgit v1.2.3