summaryrefslogtreecommitdiffstats
path: root/Wrappers/Python/ccpi
diff options
context:
space:
mode:
authorDaniil Kazantsev <dkazanc3@googlemail.com>2018-05-04 10:04:00 +0100
committerGitHub <noreply@github.com>2018-05-04 10:04:00 +0100
commitd219be09f634b156958537aefcda2dcdb6bb5200 (patch)
tree91c025c65bf810c86d0eb918b610306f0924f35d /Wrappers/Python/ccpi
parent9d0dd9704173a50226cb2d46c5418b8172b25f69 (diff)
parentfd62af62943acf481960eebbe9e986a620e6ebc9 (diff)
downloadregularization-d219be09f634b156958537aefcda2dcdb6bb5200.tar.gz
regularization-d219be09f634b156958537aefcda2dcdb6bb5200.tar.bz2
regularization-d219be09f634b156958537aefcda2dcdb6bb5200.tar.xz
regularization-d219be09f634b156958537aefcda2dcdb6bb5200.zip
Merge pull request #54 from vais-ral/FourthOrderDiffusion
Fourth order diffusion regulariser
Diffstat (limited to 'Wrappers/Python/ccpi')
-rw-r--r--Wrappers/Python/ccpi/filters/regularisers.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/Wrappers/Python/ccpi/filters/regularisers.py b/Wrappers/Python/ccpi/filters/regularisers.py
index a07b39a..0b79dac 100644
--- a/Wrappers/Python/ccpi/filters/regularisers.py
+++ b/Wrappers/Python/ccpi/filters/regularisers.py
@@ -2,8 +2,9 @@
script which assigns a proper device core function based on a flag ('cpu' or 'gpu')
"""
-from ccpi.filters.cpu_regularisers import TV_ROF_CPU, TV_FGP_CPU, TV_SB_CPU, dTV_FGP_CPU, TNV_CPU, NDF_CPU, NDF_INPAINT_CPU, NVM_INPAINT_CPU
-from ccpi.filters.gpu_regularisers import TV_ROF_GPU, TV_FGP_GPU, TV_SB_GPU, dTV_FGP_GPU, NDF_GPU
+from ccpi.filters.cpu_regularisers import TV_ROF_CPU, TV_FGP_CPU, TV_SB_CPU, dTV_FGP_CPU, TNV_CPU, NDF_CPU, Diff4th_CPU
+from ccpi.filters.gpu_regularisers import TV_ROF_GPU, TV_FGP_GPU, TV_SB_GPU, dTV_FGP_GPU, NDF_GPU, Diff4th_GPU
+from ccpi.filters.cpu_regularisers import NDF_INPAINT_CPU, NVM_INPAINT_CPU
def ROF_TV(inputData, regularisation_parameter, iterations,
time_marching_parameter,device='cpu'):
@@ -110,6 +111,23 @@ def NDF(inputData, regularisation_parameter, edge_parameter, iterations,
else:
raise ValueError('Unknown device {0}. Expecting gpu or cpu'\
.format(device))
+def DIFF4th(inputData, regularisation_parameter, edge_parameter, iterations,
+ time_marching_parameter, device='cpu'):
+ if device == 'cpu':
+ return Diff4th_CPU(inputData,
+ regularisation_parameter,
+ edge_parameter,
+ iterations,
+ time_marching_parameter)
+ elif device == 'gpu':
+ return Diff4th_GPU(inputData,
+ regularisation_parameter,
+ edge_parameter,
+ iterations,
+ time_marching_parameter)
+ else:
+ raise ValueError('Unknown device {0}. Expecting gpu or cpu'\
+ .format(device))
def NDF_INP(inputData, maskData, regularisation_parameter, edge_parameter, iterations,
time_marching_parameter, penalty_type):
return NDF_INPAINT_CPU(inputData, maskData, regularisation_parameter,