diff options
author | dkazanc <dkazanc@hotmail.com> | 2019-03-06 15:13:58 +0000 |
---|---|---|
committer | dkazanc <dkazanc@hotmail.com> | 2019-03-06 15:13:58 +0000 |
commit | 39baef90c4b209090f006e5308653cb0a3348c4e (patch) | |
tree | e85f827c91fa98a39cef941090dc260db1c76b6c /demos/SoftwareX_supp | |
parent | 5a12eb57a4965dea7241093c1fe7bf50dfac9659 (diff) | |
download | regularization-39baef90c4b209090f006e5308653cb0a3348c4e.tar.gz regularization-39baef90c4b209090f006e5308653cb0a3348c4e.tar.bz2 regularization-39baef90c4b209090f006e5308653cb0a3348c4e.tar.xz regularization-39baef90c4b209090f006e5308653cb0a3348c4e.zip |
tol work
Diffstat (limited to 'demos/SoftwareX_supp')
-rw-r--r-- | demos/SoftwareX_supp/Demo_VolumeDenoise.py | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/demos/SoftwareX_supp/Demo_VolumeDenoise.py b/demos/SoftwareX_supp/Demo_VolumeDenoise.py index 2387e94..17cdf4d 100644 --- a/demos/SoftwareX_supp/Demo_VolumeDenoise.py +++ b/demos/SoftwareX_supp/Demo_VolumeDenoise.py @@ -60,13 +60,14 @@ plt.title('3D Phantom, sagittal view') plt.show() #%% print ("____________________Applying regularisers_______________________") +print ("________________________________________________________________") print ("#############ROF TV CPU####################") # set parameters pars = {'algorithm': ROF_TV, \ 'input' : phantom_noise,\ 'regularisation_parameter':0.04,\ - 'number_of_iterations': 100,\ + 'number_of_iterations': 600,\ 'time_marching_parameter': 0.0025 } @@ -116,6 +117,65 @@ win2d = win * (win.T) ssim_rof = Qtools.ssim(win2d) print("ROF-TV (gpu) ____ RMSE: {}, MMSIM: {}, run time: {} sec".format(RMSE_rof,ssim_rof[0],Run_time_rof)) +#%% +print ("#############FGP TV CPU####################") +# set parameters +pars = {'algorithm':FGP_TV, \ + 'input' : phantom_noise,\ + 'regularisation_parameter':0.04,\ + 'number_of_iterations': 300,\ + 'time_marching_parameter': 0.0025,\ + 'tolerance_constant':1e-05,\ + } + +tic=timeit.default_timer() +fgp_cpu3D = FGP_TV(pars['input'], + pars['regularisation_parameter'], + pars['number_of_iterations'], + pars['time_marching_parameter'],'cpu') +toc=timeit.default_timer() + +Run_time_fgp = toc - tic +Qtools = QualityTools(phantom_tm, fgp_cpu3D) +RMSE_rof = Qtools.rmse() + +# SSIM measure +Qtools = QualityTools(phantom_tm[128,:,:]*255, fgp_cpu3D[128,:,:]*235) +win = np.array([gaussian(11, 1.5)]) +win2d = win * (win.T) +ssim_fgp = Qtools.ssim(win2d) + +print("FGP-TV (cpu) ____ RMSE: {}, MMSIM: {}, run time: {} sec".format(RMSE_rof,ssim_fgp[0],Run_time_fgp)) +#%% +print ("#############FGP TV GPU####################") +# set parameters +pars = {'algorithm':FGP_TV, \ + 'input' : phantom_noise,\ + 'regularisation_parameter':0.04,\ + 'number_of_iterations': 300,\ + 'time_marching_parameter': 0.0025,\ + 'tolerance_constant':1e-05,\ + } +tic=timeit.default_timer() +fgp_gpu3D = FGP_TV(pars['input'], + pars['regularisation_parameter'], + pars['number_of_iterations'], + pars['time_marching_parameter'],'gpu') +toc=timeit.default_timer() + +Run_time_fgp = toc - tic +Qtools = QualityTools(phantom_tm, fgp_gpu3D) +RMSE_rof = Qtools.rmse() + +# SSIM measure +Qtools = QualityTools(phantom_tm[128,:,:]*255, fgp_gpu3D[128,:,:]*235) +win = np.array([gaussian(11, 1.5)]) +win2d = win * (win.T) +ssim_fgp = Qtools.ssim(win2d) + +print("FGP-TV (gpu) ____ RMSE: {}, MMSIM: {}, run time: {} sec".format(RMSE_rof,ssim_fgp[0],Run_time_fgp)) #%% + + |