From 420e71a0dcb42e91e1aa93306c2e2f688b309620 Mon Sep 17 00:00:00 2001 From: dkazanc Date: Tue, 12 Mar 2019 17:29:07 +0000 Subject: cmakelists fixes, matlab wrappers done --- src/Matlab/CMakeLists.txt | 20 +++++++++++--------- .../mex_compile/installed/MEXed_files_location.txt | 0 .../mex_compile/regularisers_CPU/Diffusion_4thO.c | 4 ++-- src/Matlab/mex_compile/regularisers_CPU/FGP_TV.c | 2 +- src/Matlab/mex_compile/regularisers_CPU/FGP_dTV.c | 4 ++-- src/Matlab/mex_compile/regularisers_CPU/LLT_ROF.c | 4 ++-- src/Matlab/mex_compile/regularisers_CPU/NonlDiff.c | 4 ++-- .../mex_compile/regularisers_CPU/Nonlocal_TV.c | 4 ++-- .../mex_compile/regularisers_CPU/PatchSelect.c | 6 +++--- src/Matlab/mex_compile/regularisers_CPU/ROF_TV.c | 4 ++-- src/Matlab/mex_compile/regularisers_CPU/SB_TV.c | 2 +- src/Matlab/mex_compile/regularisers_CPU/TGV.c | 4 ++-- .../regularisers_GPU/Diffusion_4thO_GPU.cpp | 4 ++-- .../mex_compile/regularisers_GPU/FGP_TV_GPU.cpp | 4 ++-- .../mex_compile/regularisers_GPU/FGP_dTV_GPU.cpp | 4 ++-- .../mex_compile/regularisers_GPU/LLT_ROF_GPU.cpp | 4 ++-- .../mex_compile/regularisers_GPU/NonlDiff_GPU.cpp | 4 ++-- .../mex_compile/regularisers_GPU/ROF_TV_GPU.cpp | 4 ++-- .../mex_compile/regularisers_GPU/SB_TV_GPU.cpp | 2 +- src/Matlab/mex_compile/regularisers_GPU/TGV_GPU.cpp | 4 ++-- 20 files changed, 45 insertions(+), 43 deletions(-) delete mode 100644 src/Matlab/mex_compile/installed/MEXed_files_location.txt (limited to 'src/Matlab') diff --git a/src/Matlab/CMakeLists.txt b/src/Matlab/CMakeLists.txt index 6c5e6be..0897d7a 100755 --- a/src/Matlab/CMakeLists.txt +++ b/src/Matlab/CMakeLists.txt @@ -85,10 +85,10 @@ foreach(tgt RANGE 0 ${num}) ) target_include_directories(${current_target} - PUBLIC ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU - ${CMAKE_SOURCE_DIR}/Core/regularisers_GPU - ${CMAKE_SOURCE_DIR}/Core/inpainters_CPU - ${CMAKE_SOURCE_DIR}/Core/ + PUBLIC ${CMAKE_SOURCE_DIR}/src/Core/regularisers_CPU + ${CMAKE_SOURCE_DIR}/src/Core/regularisers_GPU + ${CMAKE_SOURCE_DIR}/src/Core/inpainters_CPU + ${CMAKE_SOURCE_DIR}/src/Core/ ${MATLAB_INCLUDE_DIR}) set_property(TARGET ${current_target} PROPERTY C_STANDARD 99) list(APPEND CPU_MEX_TARGETS ${current_target}) @@ -131,14 +131,16 @@ message("number of GPU files " ${num}) ) target_include_directories(${current_target} - PUBLIC ${CMAKE_SOURCE_DIR}/Core/regularisers_CPU - ${CMAKE_SOURCE_DIR}/Core/regularisers_GPU - ${CMAKE_SOURCE_DIR}/Core/inpainters_CPU - ${CMAKE_SOURCE_DIR}/Core/ + PUBLIC ${CMAKE_SOURCE_DIR}/src/Core/regularisers_CPU + ${CMAKE_SOURCE_DIR}/src/Core/regularisers_GPU + ${CMAKE_SOURCE_DIR}/src/Core/inpainters_CPU + ${CMAKE_SOURCE_DIR}/src/Core/ ${MATLAB_INCLUDE_DIR}) list(APPEND GPU_MEX_TARGETS ${current_target}) - INSTALL(TARGETS ${current_target} DESTINATION "${MATLAB_DEST}") + INSTALL(TARGETS ${current_target} DESTINATION "${MATLAB_DEST}") + + endforeach() add_custom_target(MatlabWrapperGPU DEPENDS ${GPU_MEX_TARGETS}) diff --git a/src/Matlab/mex_compile/installed/MEXed_files_location.txt b/src/Matlab/mex_compile/installed/MEXed_files_location.txt deleted file mode 100644 index e69de29..0000000 diff --git a/src/Matlab/mex_compile/regularisers_CPU/Diffusion_4thO.c b/src/Matlab/mex_compile/regularisers_CPU/Diffusion_4thO.c index a003596..887a76d 100644 --- a/src/Matlab/mex_compile/regularisers_CPU/Diffusion_4thO.c +++ b/src/Matlab/mex_compile/regularisers_CPU/Diffusion_4thO.c @@ -78,9 +78,9 @@ void mexFunction( } if (number_of_dims == 3) Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array, mxSINGLE_CLASS, mxREAL)); - int vecdim[1]; + mwSize vecdim[1]; vecdim[0] = 2; infovec = (float*)mxGetPr(plhs[1] = mxCreateNumericArray(1, vecdim, mxSINGLE_CLASS, mxREAL)); Diffus4th_CPU_main(Input, Output, infovec, lambda, sigma, iter_numb, tau, epsil, dimX, dimY, dimZ); -} \ No newline at end of file +} diff --git a/src/Matlab/mex_compile/regularisers_CPU/FGP_TV.c b/src/Matlab/mex_compile/regularisers_CPU/FGP_TV.c index f6db6c8..251ac52 100644 --- a/src/Matlab/mex_compile/regularisers_CPU/FGP_TV.c +++ b/src/Matlab/mex_compile/regularisers_CPU/FGP_TV.c @@ -89,7 +89,7 @@ void mexFunction( if (number_of_dims == 3) { Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array, mxSINGLE_CLASS, mxREAL)); } - int vecdim[1]; + mwSize vecdim[1]; vecdim[0] = 2; infovec = (float*)mxGetPr(plhs[1] = mxCreateNumericArray(1, vecdim, mxSINGLE_CLASS, mxREAL)); diff --git a/src/Matlab/mex_compile/regularisers_CPU/FGP_dTV.c b/src/Matlab/mex_compile/regularisers_CPU/FGP_dTV.c index 3122610..f1b70a8 100644 --- a/src/Matlab/mex_compile/regularisers_CPU/FGP_dTV.c +++ b/src/Matlab/mex_compile/regularisers_CPU/FGP_dTV.c @@ -101,10 +101,10 @@ void mexFunction( } if (number_of_dims == 3) Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array, mxSINGLE_CLASS, mxREAL)); - int vecdim[1]; + mwSize vecdim[1]; vecdim[0] = 2; infovec = (float*)mxGetPr(plhs[1] = mxCreateNumericArray(1, vecdim, mxSINGLE_CLASS, mxREAL)); /* running the function */ dTV_FGP_CPU_main(Input, InputRef, Output, infovec, lambda, iter, epsil, eta, methTV, nonneg, dimX, dimY, dimZ); -} \ No newline at end of file +} diff --git a/src/Matlab/mex_compile/regularisers_CPU/LLT_ROF.c b/src/Matlab/mex_compile/regularisers_CPU/LLT_ROF.c index f630397..5c6de9d 100644 --- a/src/Matlab/mex_compile/regularisers_CPU/LLT_ROF.c +++ b/src/Matlab/mex_compile/regularisers_CPU/LLT_ROF.c @@ -83,9 +83,9 @@ void mexFunction( } if (number_of_dims == 3) Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array, mxSINGLE_CLASS, mxREAL)); - int vecdim[1]; + mwSize vecdim[1]; vecdim[0] = 2; infovec = (float*)mxGetPr(plhs[1] = mxCreateNumericArray(1, vecdim, mxSINGLE_CLASS, mxREAL)); LLT_ROF_CPU_main(Input, Output, infovec, lambdaROF, lambdaLLT, iterationsNumb, tau, epsil, dimX, dimY, dimZ); -} \ No newline at end of file +} diff --git a/src/Matlab/mex_compile/regularisers_CPU/NonlDiff.c b/src/Matlab/mex_compile/regularisers_CPU/NonlDiff.c index 57c8811..2ca17d2 100644 --- a/src/Matlab/mex_compile/regularisers_CPU/NonlDiff.c +++ b/src/Matlab/mex_compile/regularisers_CPU/NonlDiff.c @@ -90,9 +90,9 @@ void mexFunction( } if (number_of_dims == 3) Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array, mxSINGLE_CLASS, mxREAL)); - int vecdim[1]; + mwSize vecdim[1]; vecdim[0] = 2; infovec = (float*)mxGetPr(plhs[1] = mxCreateNumericArray(1, vecdim, mxSINGLE_CLASS, mxREAL)); Diffusion_CPU_main(Input, Output, infovec, lambda, sigma, iter_numb, tau, penaltytype, epsil, dimX, dimY, dimZ); -} \ No newline at end of file +} diff --git a/src/Matlab/mex_compile/regularisers_CPU/Nonlocal_TV.c b/src/Matlab/mex_compile/regularisers_CPU/Nonlocal_TV.c index 014c0a0..34b9915 100644 --- a/src/Matlab/mex_compile/regularisers_CPU/Nonlocal_TV.c +++ b/src/Matlab/mex_compile/regularisers_CPU/Nonlocal_TV.c @@ -51,8 +51,8 @@ void mexFunction( long number_of_dims, dimX, dimY, dimZ; int IterNumb, NumNeighb = 0; unsigned short *H_i, *H_j, *H_k; - const int *dim_array; - const int *dim_array2; + const mwSize *dim_array; + const mwSize *dim_array2; float *A_orig, *Output=NULL, *Weights, lambda; dim_array = mxGetDimensions(prhs[0]); diff --git a/src/Matlab/mex_compile/regularisers_CPU/PatchSelect.c b/src/Matlab/mex_compile/regularisers_CPU/PatchSelect.c index f942539..d2f6670 100644 --- a/src/Matlab/mex_compile/regularisers_CPU/PatchSelect.c +++ b/src/Matlab/mex_compile/regularisers_CPU/PatchSelect.c @@ -53,10 +53,10 @@ void mexFunction( int number_of_dims, SearchWindow, SimilarWin, NumNeighb; mwSize dimX, dimY, dimZ; unsigned short *H_i=NULL, *H_j=NULL, *H_k=NULL; - const int *dim_array; + mwSize *dim_array; float *A, *Weights = NULL, h; - int dim_array2[3]; /* for 2D data */ - int dim_array3[4]; /* for 3D data */ + mwSize dim_array2[3]; /* for 2D data */ + mwSize dim_array3[4]; /* for 3D data */ dim_array = mxGetDimensions(prhs[0]); number_of_dims = mxGetNumberOfDimensions(prhs[0]); diff --git a/src/Matlab/mex_compile/regularisers_CPU/ROF_TV.c b/src/Matlab/mex_compile/regularisers_CPU/ROF_TV.c index a7d431f..ffe7b91 100644 --- a/src/Matlab/mex_compile/regularisers_CPU/ROF_TV.c +++ b/src/Matlab/mex_compile/regularisers_CPU/ROF_TV.c @@ -77,9 +77,9 @@ void mexFunction( Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array_i, mxSINGLE_CLASS, mxREAL)); } - int vecdim[1]; + mwSize vecdim[1]; vecdim[0] = 2; infovec = (float*)mxGetPr(plhs[1] = mxCreateNumericArray(1, vecdim, mxSINGLE_CLASS, mxREAL)); TV_ROF_CPU_main(Input, Output, infovec, lambda, iter_numb, tau, epsil, dimX, dimY, dimZ); -} \ No newline at end of file +} diff --git a/src/Matlab/mex_compile/regularisers_CPU/SB_TV.c b/src/Matlab/mex_compile/regularisers_CPU/SB_TV.c index 495f1c9..d1bdb3a 100644 --- a/src/Matlab/mex_compile/regularisers_CPU/SB_TV.c +++ b/src/Matlab/mex_compile/regularisers_CPU/SB_TV.c @@ -82,7 +82,7 @@ void mexFunction( } if (number_of_dims == 3) Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array, mxSINGLE_CLASS, mxREAL)); - int vecdim[1]; + mwSize vecdim[1]; vecdim[0] = 2; infovec = (float*)mxGetPr(plhs[1] = mxCreateNumericArray(1, vecdim, mxSINGLE_CLASS, mxREAL)); diff --git a/src/Matlab/mex_compile/regularisers_CPU/TGV.c b/src/Matlab/mex_compile/regularisers_CPU/TGV.c index aab01b4..2c0fcbd 100644 --- a/src/Matlab/mex_compile/regularisers_CPU/TGV.c +++ b/src/Matlab/mex_compile/regularisers_CPU/TGV.c @@ -57,7 +57,7 @@ void mexFunction( dim_array = mxGetDimensions(prhs[0]); /*Handling Matlab input data*/ - if ((nrhs < 2) || (nrhs > 6)) mexErrMsgTxt("At least 2 parameters is required, all parameters are: Image(2D), Regularisation parameter, alpha0, alpha1, iterations number, Lipshitz Constant"); + if ((nrhs < 2) || (nrhs > 7)) mexErrMsgTxt("At least 2 parameters is required, all parameters are: Image(2D), Regularisation parameter, alpha0, alpha1, iterations number, Lipshitz Constant"); Input = (float *) mxGetData(prhs[0]); /*noisy image/volume */ lambda = (float) mxGetScalar(prhs[1]); /* regularisation parameter */ @@ -85,7 +85,7 @@ void mexFunction( Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array, mxSINGLE_CLASS, mxREAL)); } - int vecdim[1]; + mwSize vecdim[1]; vecdim[0] = 2; infovec = (float*)mxGetPr(plhs[1] = mxCreateNumericArray(1, vecdim, mxSINGLE_CLASS, mxREAL)); diff --git a/src/Matlab/mex_compile/regularisers_GPU/Diffusion_4thO_GPU.cpp b/src/Matlab/mex_compile/regularisers_GPU/Diffusion_4thO_GPU.cpp index 7b7a220..42874ef 100644 --- a/src/Matlab/mex_compile/regularisers_GPU/Diffusion_4thO_GPU.cpp +++ b/src/Matlab/mex_compile/regularisers_GPU/Diffusion_4thO_GPU.cpp @@ -78,9 +78,9 @@ void mexFunction( } if (number_of_dims == 3) Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array, mxSINGLE_CLASS, mxREAL)); - int vecdim[1]; + mwSize vecdim[1]; vecdim[0] = 2; infovec = (float*)mxGetPr(plhs[1] = mxCreateNumericArray(1, vecdim, mxSINGLE_CLASS, mxREAL)); Diffus4th_GPU_main(Input, Output, infovec, lambda, sigma, iter_numb, tau, epsil, dimX, dimY, dimZ); -} \ No newline at end of file +} diff --git a/src/Matlab/mex_compile/regularisers_GPU/FGP_TV_GPU.cpp b/src/Matlab/mex_compile/regularisers_GPU/FGP_TV_GPU.cpp index 5ccc2b2..d08e50d 100644 --- a/src/Matlab/mex_compile/regularisers_GPU/FGP_TV_GPU.cpp +++ b/src/Matlab/mex_compile/regularisers_GPU/FGP_TV_GPU.cpp @@ -89,10 +89,10 @@ void mexFunction( if (number_of_dims == 3) { Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array, mxSINGLE_CLASS, mxREAL)); } - int vecdim[1]; + mwSize vecdim[1]; vecdim[0] = 2; infovec = (float*)mxGetPr(plhs[1] = mxCreateNumericArray(1, vecdim, mxSINGLE_CLASS, mxREAL)); /* running the function */ TV_FGP_GPU_main(Input, Output, infovec, lambda, iter, epsil, methTV, nonneg, dimX, dimY, dimZ); -} \ No newline at end of file +} diff --git a/src/Matlab/mex_compile/regularisers_GPU/FGP_dTV_GPU.cpp b/src/Matlab/mex_compile/regularisers_GPU/FGP_dTV_GPU.cpp index 6662e0b..2db4556 100644 --- a/src/Matlab/mex_compile/regularisers_GPU/FGP_dTV_GPU.cpp +++ b/src/Matlab/mex_compile/regularisers_GPU/FGP_dTV_GPU.cpp @@ -101,10 +101,10 @@ void mexFunction( } if (number_of_dims == 3) Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array, mxSINGLE_CLASS, mxREAL)); - int vecdim[1]; + mwSize vecdim[1]; vecdim[0] = 2; infovec = (float*)mxGetPr(plhs[1] = mxCreateNumericArray(1, vecdim, mxSINGLE_CLASS, mxREAL)); /* running the function */ dTV_FGP_GPU_main(Input, InputRef, Output, infovec, lambda, iter, epsil, eta, methTV, nonneg, dimX, dimY, dimZ); -} \ No newline at end of file +} diff --git a/src/Matlab/mex_compile/regularisers_GPU/LLT_ROF_GPU.cpp b/src/Matlab/mex_compile/regularisers_GPU/LLT_ROF_GPU.cpp index f27767e..ff5d577 100644 --- a/src/Matlab/mex_compile/regularisers_GPU/LLT_ROF_GPU.cpp +++ b/src/Matlab/mex_compile/regularisers_GPU/LLT_ROF_GPU.cpp @@ -83,9 +83,9 @@ void mexFunction( } if (number_of_dims == 3) Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array, mxSINGLE_CLASS, mxREAL)); - int vecdim[1]; + mwSize vecdim[1]; vecdim[0] = 2; infovec = (float*)mxGetPr(plhs[1] = mxCreateNumericArray(1, vecdim, mxSINGLE_CLASS, mxREAL)); LLT_ROF_GPU_main(Input, Output, infovec, lambdaROF, lambdaLLT, iterationsNumb, tau, epsil, dimX, dimY, dimZ); -} \ No newline at end of file +} diff --git a/src/Matlab/mex_compile/regularisers_GPU/NonlDiff_GPU.cpp b/src/Matlab/mex_compile/regularisers_GPU/NonlDiff_GPU.cpp index 4ce983f..43627c8 100644 --- a/src/Matlab/mex_compile/regularisers_GPU/NonlDiff_GPU.cpp +++ b/src/Matlab/mex_compile/regularisers_GPU/NonlDiff_GPU.cpp @@ -92,9 +92,9 @@ void mexFunction( } if (number_of_dims == 3) Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array, mxSINGLE_CLASS, mxREAL)); - int vecdim[1]; + mwSize vecdim[1]; vecdim[0] = 2; infovec = (float*)mxGetPr(plhs[1] = mxCreateNumericArray(1, vecdim, mxSINGLE_CLASS, mxREAL)); NonlDiff_GPU_main(Input, Output, infovec, lambda, sigma, iter_numb, tau, penaltytype, epsil, dimX, dimY, dimZ); -} \ No newline at end of file +} diff --git a/src/Matlab/mex_compile/regularisers_GPU/ROF_TV_GPU.cpp b/src/Matlab/mex_compile/regularisers_GPU/ROF_TV_GPU.cpp index 4172323..d9b7e83 100644 --- a/src/Matlab/mex_compile/regularisers_GPU/ROF_TV_GPU.cpp +++ b/src/Matlab/mex_compile/regularisers_GPU/ROF_TV_GPU.cpp @@ -75,9 +75,9 @@ void mexFunction( Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array_i, mxSINGLE_CLASS, mxREAL)); } - int vecdim[1]; + mwSize vecdim[1]; vecdim[0] = 2; infovec = (float*)mxGetPr(plhs[1] = mxCreateNumericArray(1, vecdim, mxSINGLE_CLASS, mxREAL)); TV_ROF_GPU_main(Input, Output, infovec, lambda, iter_numb, tau, epsil, dimX, dimY, dimZ); -} \ No newline at end of file +} diff --git a/src/Matlab/mex_compile/regularisers_GPU/SB_TV_GPU.cpp b/src/Matlab/mex_compile/regularisers_GPU/SB_TV_GPU.cpp index 8ec95ab..562dc65 100644 --- a/src/Matlab/mex_compile/regularisers_GPU/SB_TV_GPU.cpp +++ b/src/Matlab/mex_compile/regularisers_GPU/SB_TV_GPU.cpp @@ -72,7 +72,7 @@ void mexFunction( } if (number_of_dims == 3) Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array, mxSINGLE_CLASS, mxREAL)); - int vecdim[1]; + mwSize vecdim[1]; vecdim[0] = 2; infovec = (float*)mxGetPr(plhs[1] = mxCreateNumericArray(1, vecdim, mxSINGLE_CLASS, mxREAL)); diff --git a/src/Matlab/mex_compile/regularisers_GPU/TGV_GPU.cpp b/src/Matlab/mex_compile/regularisers_GPU/TGV_GPU.cpp index bdfd85b..eb1f043 100644 --- a/src/Matlab/mex_compile/regularisers_GPU/TGV_GPU.cpp +++ b/src/Matlab/mex_compile/regularisers_GPU/TGV_GPU.cpp @@ -60,7 +60,7 @@ void mexFunction( dim_array = mxGetDimensions(prhs[0]); /*Handling Matlab input data*/ - if ((nrhs < 2) || (nrhs > 6)) mexErrMsgTxt("At least 2 parameters is required, all parameters are: Image(2D), Regularisation parameter, alpha0, alpha1, iterations number, Lipshitz Constant"); + if ((nrhs < 2) || (nrhs > 7)) mexErrMsgTxt("At least 2 parameters is required, all parameters are: Image(2D), Regularisation parameter, alpha0, alpha1, iterations number, Lipshitz Constant"); Input = (float *) mxGetData(prhs[0]); /*noisy image/volume */ lambda = (float) mxGetScalar(prhs[1]); /* regularisation parameter */ @@ -88,7 +88,7 @@ void mexFunction( Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array, mxSINGLE_CLASS, mxREAL)); } - int vecdim[1]; + mwSize vecdim[1]; vecdim[0] = 2; infovec = (float*)mxGetPr(plhs[1] = mxCreateNumericArray(1, vecdim, mxSINGLE_CLASS, mxREAL)); -- cgit v1.2.3