summaryrefslogtreecommitdiffstats
path: root/Wrappers/Python/demos
diff options
context:
space:
mode:
authoralgol <dkazanc@hotmail.com>2018-05-04 09:38:13 +0100
committeralgol <dkazanc@hotmail.com>2018-05-04 09:38:13 +0100
commit824fafc9d39bfd3a27ffdb29c37f873e6097c3f7 (patch)
treefd791ddf3e6364b7f568341ca39ce973748c1d2d /Wrappers/Python/demos
parent66b101901f29776486009d165221d03a57316a0e (diff)
downloadregularization-824fafc9d39bfd3a27ffdb29c37f873e6097c3f7.tar.gz
regularization-824fafc9d39bfd3a27ffdb29c37f873e6097c3f7.tar.bz2
regularization-824fafc9d39bfd3a27ffdb29c37f873e6097c3f7.tar.xz
regularization-824fafc9d39bfd3a27ffdb29c37f873e6097c3f7.zip
demos for Diff4thO
Diffstat (limited to 'Wrappers/Python/demos')
-rw-r--r--Wrappers/Python/demos/demo_cpu_regularisers.py2
-rw-r--r--Wrappers/Python/demos/demo_cpu_regularisers3D.py9
-rw-r--r--Wrappers/Python/demos/demo_cpu_vs_gpu_regularisers.py8
-rw-r--r--Wrappers/Python/demos/demo_gpu_regularisers.py2
-rw-r--r--Wrappers/Python/demos/demo_gpu_regularisers3D.py2
5 files changed, 10 insertions, 13 deletions
diff --git a/Wrappers/Python/demos/demo_cpu_regularisers.py b/Wrappers/Python/demos/demo_cpu_regularisers.py
index 51e7fb5..ff500ae 100644
--- a/Wrappers/Python/demos/demo_cpu_regularisers.py
+++ b/Wrappers/Python/demos/demo_cpu_regularisers.py
@@ -271,7 +271,7 @@ pars = {'algorithm' : DIFF4th, \
'regularisation_parameter':3.5, \
'edge_parameter':0.02,\
'number_of_iterations' :500 ,\
- 'time_marching_parameter':0.005
+ 'time_marching_parameter':0.0015
}
print ("#############DIFF4th CPU################")
diff --git a/Wrappers/Python/demos/demo_cpu_regularisers3D.py b/Wrappers/Python/demos/demo_cpu_regularisers3D.py
index 0f47ea9..8ee157e 100644
--- a/Wrappers/Python/demos/demo_cpu_regularisers3D.py
+++ b/Wrappers/Python/demos/demo_cpu_regularisers3D.py
@@ -12,7 +12,7 @@ import matplotlib.pyplot as plt
import numpy as np
import os
import timeit
-from ccpi.filters.regularisers import ROF_TV, FGP_TV, SB_TV, FGP_dTV, TNV, NDF, DIFF4th
+from ccpi.filters.regularisers import ROF_TV, FGP_TV, SB_TV, FGP_dTV, NDF, DIFF4th
from qualitymetrics import rmse
###############################################################################
def printParametersToString(pars):
@@ -68,9 +68,6 @@ Im2[:,0:M] = Im[:,0:M]
Im = Im2
del Im2
"""
-
-# Uncomment to test 3D regularisation performance
-#%%
slices = 20
noisyVol = np.zeros((slices,N,M),dtype='float32')
@@ -82,7 +79,7 @@ for i in range (slices):
noisyRef[i,:,:] = Im + np.random.normal(loc = 0 , scale = 0.01 * Im , size = np.shape(Im))
idealVol[i,:,:] = Im
-
+#%%
print ("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
print ("_______________ROF-TV (3D)_________________")
print ("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
@@ -283,7 +280,7 @@ pars = {'algorithm' : DIFF4th, \
'regularisation_parameter':3.5, \
'edge_parameter':0.02,\
'number_of_iterations' :300 ,\
- 'time_marching_parameter':0.005
+ 'time_marching_parameter':0.0015
}
print ("#############DIFF4th CPU################")
diff --git a/Wrappers/Python/demos/demo_cpu_vs_gpu_regularisers.py b/Wrappers/Python/demos/demo_cpu_vs_gpu_regularisers.py
index 2910c65..4611522 100644
--- a/Wrappers/Python/demos/demo_cpu_vs_gpu_regularisers.py
+++ b/Wrappers/Python/demos/demo_cpu_vs_gpu_regularisers.py
@@ -408,12 +408,12 @@ pars = {'algorithm' : DIFF4th, \
'regularisation_parameter':3.5, \
'edge_parameter':0.02,\
'number_of_iterations' :500 ,\
- 'time_marching_parameter':0.005
+ 'time_marching_parameter':0.001
}
print ("#############Diff4th CPU####################")
start_time = timeit.default_timer()
-diff4th_cpu = Diff4th(pars['input'],
+diff4th_cpu = DIFF4th(pars['input'],
pars['regularisation_parameter'],
pars['edge_parameter'],
pars['number_of_iterations'],
@@ -437,7 +437,7 @@ plt.title('{}'.format('CPU results'))
print ("##############Diff4th GPU##################")
start_time = timeit.default_timer()
-diff4th_gpu = Diff4th(pars['input'],
+diff4th_gpu = DIFF4th(pars['input'],
pars['regularisation_parameter'],
pars['edge_parameter'],
pars['number_of_iterations'],
@@ -445,7 +445,7 @@ diff4th_gpu = Diff4th(pars['input'],
rms = rmse(Im, diff4th_gpu)
pars['rmse'] = rms
-pars['algorithm'] = Diff4th
+pars['algorithm'] = DIFF4th
txtstr = printParametersToString(pars)
txtstr += "%s = %.3fs" % ('elapsed time',timeit.default_timer() - start_time)
print (txtstr)
diff --git a/Wrappers/Python/demos/demo_gpu_regularisers.py b/Wrappers/Python/demos/demo_gpu_regularisers.py
index 8432696..3179428 100644
--- a/Wrappers/Python/demos/demo_gpu_regularisers.py
+++ b/Wrappers/Python/demos/demo_gpu_regularisers.py
@@ -269,7 +269,7 @@ pars = {'algorithm' : DIFF4th, \
'regularisation_parameter':3.5, \
'edge_parameter':0.02,\
'number_of_iterations' :500 ,\
- 'time_marching_parameter':0.005
+ 'time_marching_parameter':0.0015
}
print ("#############DIFF4th CPU################")
diff --git a/Wrappers/Python/demos/demo_gpu_regularisers3D.py b/Wrappers/Python/demos/demo_gpu_regularisers3D.py
index 022df95..13c4e7b 100644
--- a/Wrappers/Python/demos/demo_gpu_regularisers3D.py
+++ b/Wrappers/Python/demos/demo_gpu_regularisers3D.py
@@ -285,7 +285,7 @@ pars = {'algorithm' : DIFF4th, \
'regularisation_parameter':3.5, \
'edge_parameter':0.02,\
'number_of_iterations' :300 ,\
- 'time_marching_parameter':0.005
+ 'time_marching_parameter':0.0015
}
print ("#############DIFF4th CPU################")