summaryrefslogtreecommitdiffstats
path: root/Wrappers/Python/demos
diff options
context:
space:
mode:
authoralgol <dkazanc@hotmail.com>2018-04-12 11:56:54 +0100
committeralgol <dkazanc@hotmail.com>2018-04-12 11:56:54 +0100
commit22f6e22cbe6db04c6bbe8d259ce761e3748d7102 (patch)
tree225dcf0db9dc7e0f0fc5fc001a7efb14c19658f8 /Wrappers/Python/demos
parent58f5ce047b063d53906e38047b6ae744ccdbd4eb (diff)
downloadregularization-22f6e22cbe6db04c6bbe8d259ce761e3748d7102.tar.gz
regularization-22f6e22cbe6db04c6bbe8d259ce761e3748d7102.tar.bz2
regularization-22f6e22cbe6db04c6bbe8d259ce761e3748d7102.tar.xz
regularization-22f6e22cbe6db04c6bbe8d259ce761e3748d7102.zip
dTV some bugs in cython
Diffstat (limited to 'Wrappers/Python/demos')
-rw-r--r--Wrappers/Python/demos/demo_cpu_regularisers.py9
-rw-r--r--Wrappers/Python/demos/demo_cpu_vs_gpu_regularisers.py2
-rw-r--r--Wrappers/Python/demos/demo_gpu_regularisers.py8
3 files changed, 13 insertions, 6 deletions
diff --git a/Wrappers/Python/demos/demo_cpu_regularisers.py b/Wrappers/Python/demos/demo_cpu_regularisers.py
index fd3050c..00beb0b 100644
--- a/Wrappers/Python/demos/demo_cpu_regularisers.py
+++ b/Wrappers/Python/demos/demo_cpu_regularisers.py
@@ -22,6 +22,8 @@ def printParametersToString(pars):
txt += "{0} = {1}".format(key, value.__name__)
elif key == 'input':
txt += "{0} = {1}".format(key, np.shape(value))
+ elif key == 'refdata':
+ txt += "{0} = {1}".format(key, np.shape(value))
else:
txt += "{0} = {1}".format(key, value)
txt += '\n'
@@ -196,7 +198,7 @@ plt.title('{}'.format('CPU results'))
# Uncomment to test 3D regularisation performance
#%%
-
+"""
N = 512
slices = 20
@@ -318,8 +320,8 @@ a.set_title('Noisy Image')
imgplot = plt.imshow(noisyVol[10,:,:],cmap="gray")
# set parameters
-pars = {'algorithm' : FGP_dTV, \
- 'input' : noisyVol,\
+pars = {'algorithm' : FGP_dTV,\
+ 'input' : noisyVol,\
'refdata' : noisyRef,\
'regularisation_parameter':0.04, \
'number_of_iterations' :300 ,\
@@ -358,4 +360,5 @@ a.text(0.15, 0.25, txtstr, transform=a.transAxes, fontsize=14,
verticalalignment='top', bbox=props)
imgplot = plt.imshow(fgp_dTV_cpu3D[10,:,:], cmap="gray")
plt.title('{}'.format('Recovered volume on the CPU using FGP-dTV'))
+"""
#%%
diff --git a/Wrappers/Python/demos/demo_cpu_vs_gpu_regularisers.py b/Wrappers/Python/demos/demo_cpu_vs_gpu_regularisers.py
index aa1f865..310cf75 100644
--- a/Wrappers/Python/demos/demo_cpu_vs_gpu_regularisers.py
+++ b/Wrappers/Python/demos/demo_cpu_vs_gpu_regularisers.py
@@ -22,6 +22,8 @@ def printParametersToString(pars):
txt += "{0} = {1}".format(key, value.__name__)
elif key == 'input':
txt += "{0} = {1}".format(key, np.shape(value))
+ elif key == 'refdata':
+ txt += "{0} = {1}".format(key, np.shape(value))
else:
txt += "{0} = {1}".format(key, value)
txt += '\n'
diff --git a/Wrappers/Python/demos/demo_gpu_regularisers.py b/Wrappers/Python/demos/demo_gpu_regularisers.py
index 4759cc3..24a3c88 100644
--- a/Wrappers/Python/demos/demo_gpu_regularisers.py
+++ b/Wrappers/Python/demos/demo_gpu_regularisers.py
@@ -22,6 +22,8 @@ def printParametersToString(pars):
txt += "{0} = {1}".format(key, value.__name__)
elif key == 'input':
txt += "{0} = {1}".format(key, np.shape(value))
+ elif key == 'refdata':
+ txt += "{0} = {1}".format(key, np.shape(value))
else:
txt += "{0} = {1}".format(key, value)
txt += '\n'
@@ -192,7 +194,7 @@ plt.title('{}'.format('GPU results'))
# Uncomment to test 3D regularisation performance
#%%
-
+"""
N = 512
slices = 20
@@ -314,7 +316,7 @@ imgplot = plt.imshow(noisyVol[10,:,:],cmap="gray")
# set parameters
pars = {'algorithm' : FGP_dTV, \
- 'input' : noisyVol,\
+ 'input' : noisyVol,\
'refdata' : noisyRef,\
'regularisation_parameter':0.04, \
'number_of_iterations' :300 ,\
@@ -352,5 +354,5 @@ a.text(0.15, 0.25, txtstr, transform=a.transAxes, fontsize=14,
verticalalignment='top', bbox=props)
imgplot = plt.imshow(fgp_dTV_gpu3D[10,:,:], cmap="gray")
plt.title('{}'.format('Recovered volume on the GPU using FGP-dTV'))
-
+"""
#%%