summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorDaniil Kazantsev <dkazanc@hotmail.com>2019-03-06 23:34:55 +0000
committerDaniil Kazantsev <dkazanc@hotmail.com>2019-03-06 23:34:55 +0000
commitcfcc4be4413f65a0b9c4ef197687e3a167eff0e8 (patch)
tree41f7154e9e986d6429be9ba6289902edf1f91ec7 /demos
parent4b29a6adc924bf8a4b3e4f9835ded93a3a2f7b92 (diff)
downloadregularization-cfcc4be4413f65a0b9c4ef197687e3a167eff0e8.tar.gz
regularization-cfcc4be4413f65a0b9c4ef197687e3a167eff0e8.tar.bz2
regularization-cfcc4be4413f65a0b9c4ef197687e3a167eff0e8.tar.xz
regularization-cfcc4be4413f65a0b9c4ef197687e3a167eff0e8.zip
cont1
Diffstat (limited to 'demos')
-rw-r--r--demos/SoftwareX_supp/Demo_VolumeDenoise.py44
-rw-r--r--demos/demo_cpu_regularisers.py21
2 files changed, 35 insertions, 30 deletions
diff --git a/demos/SoftwareX_supp/Demo_VolumeDenoise.py b/demos/SoftwareX_supp/Demo_VolumeDenoise.py
index 17cdf4d..6e7ea46 100644
--- a/demos/SoftwareX_supp/Demo_VolumeDenoise.py
+++ b/demos/SoftwareX_supp/Demo_VolumeDenoise.py
@@ -120,19 +120,21 @@ print("ROF-TV (gpu) ____ RMSE: {}, MMSIM: {}, run time: {} sec".format(RMSE_rof,
#%%
print ("#############FGP TV CPU####################")
# set parameters
-pars = {'algorithm':FGP_TV, \
+pars = {'algorithm' : FGP_TV, \
'input' : phantom_noise,\
- 'regularisation_parameter':0.04,\
- 'number_of_iterations': 300,\
- 'time_marching_parameter': 0.0025,\
- 'tolerance_constant':1e-05,\
- }
+ 'regularisation_parameter':0.05, \
+ 'number_of_iterations' :100 ,\
+ 'tolerance_constant':1e-04,\
+ 'methodTV': 0 ,\
+ 'nonneg': 0}
tic=timeit.default_timer()
-fgp_cpu3D = FGP_TV(pars['input'],
- pars['regularisation_parameter'],
- pars['number_of_iterations'],
- pars['time_marching_parameter'],'cpu')
+(fgp_cpu3D, infoFGP) = FGP_TV(pars['input'],
+ pars['regularisation_parameter'],
+ pars['number_of_iterations'],
+ pars['tolerance_constant'],
+ pars['methodTV'],
+ pars['nonneg'],'cpu')
toc=timeit.default_timer()
Run_time_fgp = toc - tic
@@ -149,19 +151,21 @@ print("FGP-TV (cpu) ____ RMSE: {}, MMSIM: {}, run time: {} sec".format(RMSE_rof,
#%%
print ("#############FGP TV GPU####################")
# set parameters
-pars = {'algorithm':FGP_TV, \
+pars = {'algorithm' : FGP_TV, \
'input' : phantom_noise,\
- 'regularisation_parameter':0.04,\
- 'number_of_iterations': 300,\
- 'time_marching_parameter': 0.0025,\
- 'tolerance_constant':1e-05,\
- }
+ 'regularisation_parameter':0.05, \
+ 'number_of_iterations' :80 ,\
+ 'tolerance_constant':1e-04,\
+ 'methodTV': 0 ,\
+ 'nonneg': 0}
tic=timeit.default_timer()
-fgp_gpu3D = FGP_TV(pars['input'],
- pars['regularisation_parameter'],
- pars['number_of_iterations'],
- pars['time_marching_parameter'],'gpu')
+(fgp_gpu3D) = FGP_TV(pars['input'],
+ pars['regularisation_parameter'],
+ pars['number_of_iterations'],
+ pars['tolerance_constant'],
+ pars['methodTV'],
+ pars['nonneg'],'gpu')
toc=timeit.default_timer()
Run_time_fgp = toc - tic
diff --git a/demos/demo_cpu_regularisers.py b/demos/demo_cpu_regularisers.py
index 8fa7022..32b97ce 100644
--- a/demos/demo_cpu_regularisers.py
+++ b/demos/demo_cpu_regularisers.py
@@ -32,7 +32,7 @@ def printParametersToString(pars):
###############################################################################
#filename = os.path.join( "data" ,"lena_gray_512.tif")
-filename = "/home/kjy41806/Documents/SOFT/CCPi-Regularisation-Toolkit/test/lena_gray_512.tif"
+filename = "/home/algol/Documents/DEV/CCPi-Regularisation-Toolkit/test/lena_gray_512.tif"
# read image
Im = plt.imread(filename)
@@ -86,15 +86,17 @@ imgplot = plt.imshow(u0,cmap="gray")
pars = {'algorithm': ROF_TV, \
'input' : u0,\
'regularisation_parameter':0.02,\
- 'number_of_iterations': 2000,\
- 'time_marching_parameter': 0.0025
- }
+ 'number_of_iterations': 5000,\
+ 'time_marching_parameter': 0.000385,\
+ 'tolerance_constant':1e-06}
+
print ("#############ROF TV CPU####################")
start_time = timeit.default_timer()
-rof_cpu = ROF_TV(pars['input'],
+(rof_cpu,info_vec) = ROF_TV(pars['input'],
pars['regularisation_parameter'],
pars['number_of_iterations'],
- pars['time_marching_parameter'],'cpu')
+ pars['time_marching_parameter'],
+ pars['tolerance_constant'], 'cpu')
Qtools = QualityTools(Im, rof_cpu)
pars['rmse'] = Qtools.rmse()
@@ -127,12 +129,11 @@ imgplot = plt.imshow(u0,cmap="gray")
# set parameters
pars = {'algorithm' : FGP_TV, \
'input' : u0,\
- 'regularisation_parameter':0.04, \
+ 'regularisation_parameter':0.02, \
'number_of_iterations' :800 ,\
- 'tolerance_constant':1e-07,\
+ 'tolerance_constant':1e-06,\
'methodTV': 0 ,\
- 'nonneg': 0
- }
+ 'nonneg': 0}
print ("#############FGP TV CPU####################")
start_time = timeit.default_timer()