diff options
author | Daniil Kazantsev <dkazanc@hotmail.com> | 2018-04-09 13:41:06 +0100 |
---|---|---|
committer | Daniil Kazantsev <dkazanc@hotmail.com> | 2018-04-09 13:41:06 +0100 |
commit | b9fafd363d1d181a4a8b42ea4038924097207913 (patch) | |
tree | cdc7c4469e210a52cb416b2747ca2d954da073cc /Wrappers/Python/src | |
parent | a5b5872b76bf00023a7e7cee97e028003ccbc45e (diff) | |
download | regularization-b9fafd363d1d181a4a8b42ea4038924097207913.tar.gz regularization-b9fafd363d1d181a4a8b42ea4038924097207913.tar.bz2 regularization-b9fafd363d1d181a4a8b42ea4038924097207913.tar.xz regularization-b9fafd363d1d181a4a8b42ea4038924097207913.zip |
major renaming and new 3D demos for Matlab
Diffstat (limited to 'Wrappers/Python/src')
-rw-r--r-- | Wrappers/Python/src/cpu_regularisers.pyx (renamed from Wrappers/Python/src/cpu_regularizers.pyx) | 28 | ||||
-rw-r--r-- | Wrappers/Python/src/gpu_regularisers.pyx (renamed from Wrappers/Python/src/gpu_regularizers.pyx) | 28 |
2 files changed, 28 insertions, 28 deletions
diff --git a/Wrappers/Python/src/cpu_regularizers.pyx b/Wrappers/Python/src/cpu_regularisers.pyx index f993e54..248bad1 100644 --- a/Wrappers/Python/src/cpu_regularizers.pyx +++ b/Wrappers/Python/src/cpu_regularisers.pyx @@ -25,14 +25,14 @@ cdef extern float TV_FGP_CPU_main(float *Input, float *Output, float lambdaPar, #****************************************************************# #********************** Total-variation ROF *********************# #****************************************************************# -def TV_ROF_CPU(inputData, regularization_parameter, iterationsNumb, marching_step_parameter): +def TV_ROF_CPU(inputData, regularisation_parameter, iterationsNumb, marching_step_parameter): if inputData.ndim == 2: - return TV_ROF_2D(inputData, regularization_parameter, iterationsNumb, marching_step_parameter) + return TV_ROF_2D(inputData, regularisation_parameter, iterationsNumb, marching_step_parameter) elif inputData.ndim == 3: - return TV_ROF_3D(inputData, regularization_parameter, iterationsNumb, marching_step_parameter) + return TV_ROF_3D(inputData, regularisation_parameter, iterationsNumb, marching_step_parameter) def TV_ROF_2D(np.ndarray[np.float32_t, ndim=2, mode="c"] inputData, - float regularization_parameter, + float regularisation_parameter, int iterationsNumb, float marching_step_parameter): cdef long dims[2] @@ -43,13 +43,13 @@ def TV_ROF_2D(np.ndarray[np.float32_t, ndim=2, mode="c"] inputData, np.zeros([dims[0],dims[1]], dtype='float32') # Run ROF iterations for 2D data - TV_ROF_CPU_main(&inputData[0,0], &outputData[0,0], regularization_parameter, iterationsNumb, marching_step_parameter, dims[0], dims[1], 1) + TV_ROF_CPU_main(&inputData[0,0], &outputData[0,0], regularisation_parameter, iterationsNumb, marching_step_parameter, dims[0], dims[1], 1) return outputData def TV_ROF_3D(np.ndarray[np.float32_t, ndim=3, mode="c"] inputData, int iterationsNumb, - float regularization_parameter, + float regularisation_parameter, float marching_step_parameter): cdef long dims[3] dims[0] = inputData.shape[0] @@ -60,7 +60,7 @@ def TV_ROF_3D(np.ndarray[np.float32_t, ndim=3, mode="c"] inputData, np.zeros([dims[0],dims[1],dims[2]], dtype='float32') # Run ROF iterations for 3D data - TV_ROF_CPU_main(&inputData[0,0,0], &outputData[0,0,0], regularization_parameter, iterationsNumb, marching_step_parameter, dims[0], dims[1], dims[2]) + TV_ROF_CPU_main(&inputData[0,0,0], &outputData[0,0,0], regularisation_parameter, iterationsNumb, marching_step_parameter, dims[0], dims[1], dims[2]) return outputData @@ -68,14 +68,14 @@ def TV_ROF_3D(np.ndarray[np.float32_t, ndim=3, mode="c"] inputData, #********************** Total-variation FGP *********************# #****************************************************************# #******** Total-variation Fast-Gradient-Projection (FGP)*********# -def TV_FGP_CPU(inputData, regularization_parameter, iterationsNumb, tolerance_param, methodTV, nonneg, printM): +def TV_FGP_CPU(inputData, regularisation_parameter, iterationsNumb, tolerance_param, methodTV, nonneg, printM): if inputData.ndim == 2: - return TV_FGP_2D(inputData, regularization_parameter, iterationsNumb, tolerance_param, methodTV, nonneg, printM) + return TV_FGP_2D(inputData, regularisation_parameter, iterationsNumb, tolerance_param, methodTV, nonneg, printM) elif inputData.ndim == 3: - return TV_FGP_3D(inputData, regularization_parameter, iterationsNumb, tolerance_param, methodTV, nonneg, printM) + return TV_FGP_3D(inputData, regularisation_parameter, iterationsNumb, tolerance_param, methodTV, nonneg, printM) def TV_FGP_2D(np.ndarray[np.float32_t, ndim=2, mode="c"] inputData, - float regularization_parameter, + float regularisation_parameter, int iterationsNumb, float tolerance_param, int methodTV, @@ -90,7 +90,7 @@ def TV_FGP_2D(np.ndarray[np.float32_t, ndim=2, mode="c"] inputData, np.zeros([dims[0],dims[1]], dtype='float32') #/* Run ROF iterations for 2D data */ - TV_FGP_CPU_main(&inputData[0,0], &outputData[0,0], regularization_parameter, + TV_FGP_CPU_main(&inputData[0,0], &outputData[0,0], regularisation_parameter, iterationsNumb, tolerance_param, methodTV, @@ -101,7 +101,7 @@ def TV_FGP_2D(np.ndarray[np.float32_t, ndim=2, mode="c"] inputData, return outputData def TV_FGP_3D(np.ndarray[np.float32_t, ndim=3, mode="c"] inputData, - float regularization_parameter, + float regularisation_parameter, int iterationsNumb, float tolerance_param, int methodTV, @@ -116,7 +116,7 @@ def TV_FGP_3D(np.ndarray[np.float32_t, ndim=3, mode="c"] inputData, np.zeros([dims[0], dims[1], dims[2]], dtype='float32') #/* Run ROF iterations for 3D data */ - TV_FGP_CPU_main(&inputData[0,0,0], &outputData[0,0,0], regularization_parameter, + TV_FGP_CPU_main(&inputData[0,0,0], &outputData[0,0,0], regularisation_parameter, iterationsNumb, tolerance_param, methodTV, diff --git a/Wrappers/Python/src/gpu_regularizers.pyx b/Wrappers/Python/src/gpu_regularisers.pyx index a44bd1d..7ebd011 100644 --- a/Wrappers/Python/src/gpu_regularizers.pyx +++ b/Wrappers/Python/src/gpu_regularisers.pyx @@ -23,23 +23,23 @@ cdef extern void TV_FGP_GPU_main(float *Input, float *Output, float lambdaPar, i # Total-variation Rudin-Osher-Fatemi (ROF) def TV_ROF_GPU(inputData, - regularization_parameter, + regularisation_parameter, iterations, time_marching_parameter): if inputData.ndim == 2: return ROFTV2D(inputData, - regularization_parameter, + regularisation_parameter, iterations, time_marching_parameter) elif inputData.ndim == 3: return ROFTV3D(inputData, - regularization_parameter, + regularisation_parameter, iterations, time_marching_parameter) # Total-variation Fast-Gradient-Projection (FGP) def TV_FGP_GPU(inputData, - regularization_parameter, + regularisation_parameter, iterations, tolerance_param, methodTV, @@ -47,7 +47,7 @@ def TV_FGP_GPU(inputData, printM): if inputData.ndim == 2: return FGPTV2D(inputData, - regularization_parameter, + regularisation_parameter, iterations, tolerance_param, methodTV, @@ -55,7 +55,7 @@ def TV_FGP_GPU(inputData, printM) elif inputData.ndim == 3: return FGPTV3D(inputData, - regularization_parameter, + regularisation_parameter, iterations, tolerance_param, methodTV, @@ -66,7 +66,7 @@ def TV_FGP_GPU(inputData, #********************** Total-variation ROF *********************# #****************************************************************# def ROFTV2D(np.ndarray[np.float32_t, ndim=2, mode="c"] inputData, - float regularization_parameter, + float regularisation_parameter, int iterations, float time_marching_parameter): @@ -80,7 +80,7 @@ def ROFTV2D(np.ndarray[np.float32_t, ndim=2, mode="c"] inputData, # Running CUDA code here TV_ROF_GPU_main( &inputData[0,0], &outputData[0,0], - regularization_parameter, + regularisation_parameter, iterations , time_marching_parameter, dims[0], dims[1], 1); @@ -88,7 +88,7 @@ def ROFTV2D(np.ndarray[np.float32_t, ndim=2, mode="c"] inputData, return outputData def ROFTV3D(np.ndarray[np.float32_t, ndim=3, mode="c"] inputData, - float regularization_parameter, + float regularisation_parameter, int iterations, float time_marching_parameter): @@ -103,7 +103,7 @@ def ROFTV3D(np.ndarray[np.float32_t, ndim=3, mode="c"] inputData, # Running CUDA code here TV_ROF_GPU_main( &inputData[0,0,0], &outputData[0,0,0], - regularization_parameter, + regularisation_parameter, iterations , time_marching_parameter, dims[0], dims[1], dims[2]); @@ -114,7 +114,7 @@ def ROFTV3D(np.ndarray[np.float32_t, ndim=3, mode="c"] inputData, #****************************************************************# #******** Total-variation Fast-Gradient-Projection (FGP)*********# def FGPTV2D(np.ndarray[np.float32_t, ndim=2, mode="c"] inputData, - float regularization_parameter, + float regularisation_parameter, int iterations, float tolerance_param, int methodTV, @@ -130,7 +130,7 @@ def FGPTV2D(np.ndarray[np.float32_t, ndim=2, mode="c"] inputData, # Running CUDA code here TV_FGP_GPU_main(&inputData[0,0], &outputData[0,0], - regularization_parameter, + regularisation_parameter, iterations, tolerance_param, methodTV, @@ -141,7 +141,7 @@ def FGPTV2D(np.ndarray[np.float32_t, ndim=2, mode="c"] inputData, return outputData def FGPTV3D(np.ndarray[np.float32_t, ndim=3, mode="c"] inputData, - float regularization_parameter, + float regularisation_parameter, int iterations, float tolerance_param, int methodTV, @@ -159,7 +159,7 @@ def FGPTV3D(np.ndarray[np.float32_t, ndim=3, mode="c"] inputData, # Running CUDA code here TV_FGP_GPU_main( &inputData[0,0,0], &outputData[0,0,0], - regularization_parameter , + regularisation_parameter , iterations, tolerance_param, methodTV, |