summaryrefslogtreecommitdiffstats
path: root/Wrappers/Python/ccpi
diff options
context:
space:
mode:
authoralgol <dkazanc@hotmail.com>2018-04-19 13:24:30 +0100
committeralgol <dkazanc@hotmail.com>2018-04-19 13:24:30 +0100
commitb1b26855c4cd5a3e2624b280b64adeda6793b4d7 (patch)
treef3fbf76cfd2350c8794163845dc94c012c04a3a8 /Wrappers/Python/ccpi
parent0e9b9afa6a4c3ddb7afa1437204846c515386d15 (diff)
downloadregularization-b1b26855c4cd5a3e2624b280b64adeda6793b4d7.tar.gz
regularization-b1b26855c4cd5a3e2624b280b64adeda6793b4d7.tar.bz2
regularization-b1b26855c4cd5a3e2624b280b64adeda6793b4d7.tar.xz
regularization-b1b26855c4cd5a3e2624b280b64adeda6793b4d7.zip
Anisotropic Diffusion modules added for 2D/3D CPU/GPU
Diffstat (limited to 'Wrappers/Python/ccpi')
-rw-r--r--Wrappers/Python/ccpi/filters/regularisers.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/Wrappers/Python/ccpi/filters/regularisers.py b/Wrappers/Python/ccpi/filters/regularisers.py
index e6814e8..eec8c4d 100644
--- a/Wrappers/Python/ccpi/filters/regularisers.py
+++ b/Wrappers/Python/ccpi/filters/regularisers.py
@@ -2,8 +2,8 @@
script which assigns a proper device core function based on a flag ('cpu' or 'gpu')
"""
-from ccpi.filters.cpu_regularisers_cython import TV_ROF_CPU, TV_FGP_CPU, TV_SB_CPU, dTV_FGP_CPU, TNV_CPU
-from ccpi.filters.gpu_regularisers import TV_ROF_GPU, TV_FGP_GPU, TV_SB_GPU, dTV_FGP_GPU
+from ccpi.filters.cpu_regularisers_cython import TV_ROF_CPU, TV_FGP_CPU, TV_SB_CPU, dTV_FGP_CPU, TNV_CPU, NDF_CPU
+from ccpi.filters.gpu_regularisers import TV_ROF_GPU, TV_FGP_GPU, TV_SB_GPU, dTV_FGP_GPU, NDF_GPU
def ROF_TV(inputData, regularisation_parameter, iterations,
time_marching_parameter,device='cpu'):
@@ -91,3 +91,22 @@ def TNV(inputData, regularisation_parameter, iterations, tolerance_param):
regularisation_parameter,
iterations,
tolerance_param)
+def NDF(inputData, regularisation_parameter, edge_parameter, iterations,
+ time_marching_parameter, penalty_type, device='cpu'):
+ if device == 'cpu':
+ return NDF_CPU(inputData,
+ regularisation_parameter,
+ edge_parameter,
+ iterations,
+ time_marching_parameter,
+ penalty_type)
+ elif device == 'gpu':
+ return NDF_GPU(inputData,
+ regularisation_parameter,
+ edge_parameter,
+ iterations,
+ time_marching_parameter,
+ penalty_type)
+ else:
+ raise ValueError('Unknown device {0}. Expecting gpu or cpu'\
+ .format(device))