summaryrefslogtreecommitdiffstats
path: root/Wrappers/Matlab
diff options
context:
space:
mode:
authoralgol <dkazanc@hotmail.com>2018-08-10 16:24:48 +0100
committeralgol <dkazanc@hotmail.com>2018-08-10 16:24:48 +0100
commit5483927af925b3892f2f48ef4eb12c07e3ce862a (patch)
treeb67d692f10b943a8145d58179ede66676186aa81 /Wrappers/Matlab
parent7d5b8c2047faf0f260c838a88f8becf5ee7077dc (diff)
downloadregularization-5483927af925b3892f2f48ef4eb12c07e3ce862a.tar.gz
regularization-5483927af925b3892f2f48ef4eb12c07e3ce862a.tar.bz2
regularization-5483927af925b3892f2f48ef4eb12c07e3ce862a.tar.xz
regularization-5483927af925b3892f2f48ef4eb12c07e3ce862a.zip
MWsize CPU fix
Diffstat (limited to 'Wrappers/Matlab')
-rw-r--r--Wrappers/Matlab/mex_compile/regularisers_CPU/Diffusion_4thO.c5
-rw-r--r--Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_TV.c5
-rw-r--r--Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_dTV.c7
-rw-r--r--Wrappers/Matlab/mex_compile/regularisers_CPU/LLT_ROF.c5
-rw-r--r--Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff.c6
-rw-r--r--Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff_Inp.c10
-rw-r--r--Wrappers/Matlab/mex_compile/regularisers_CPU/NonlocalMarching_Inpaint.c8
-rw-r--r--Wrappers/Matlab/mex_compile/regularisers_CPU/ROF_TV.c14
-rw-r--r--Wrappers/Matlab/mex_compile/regularisers_CPU/SB_TV.c6
-rw-r--r--Wrappers/Matlab/mex_compile/regularisers_CPU/TGV.c6
-rw-r--r--Wrappers/Matlab/mex_compile/regularisers_CPU/TNV.c5
-rw-r--r--Wrappers/Matlab/mex_compile/regularisers_CPU/TV_energy.c6
12 files changed, 46 insertions, 37 deletions
diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/Diffusion_4thO.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/Diffusion_4thO.c
index 81c0600..66ea9be 100644
--- a/Wrappers/Matlab/mex_compile/regularisers_CPU/Diffusion_4thO.c
+++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/Diffusion_4thO.c
@@ -42,8 +42,9 @@ void mexFunction(
int nrhs, const mxArray *prhs[])
{
- int number_of_dims, iter_numb, dimX, dimY, dimZ;
- const int *dim_array;
+ int number_of_dims, iter_numb;
+ mwSize dimX, dimY, dimZ;
+ const mwSize *dim_array;
float *Input, *Output=NULL, lambda, tau, sigma;
dim_array = mxGetDimensions(prhs[0]);
diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_TV.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_TV.c
index aae1cb7..642362f 100644
--- a/Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_TV.c
+++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_TV.c
@@ -44,8 +44,9 @@ void mexFunction(
int nrhs, const mxArray *prhs[])
{
- int number_of_dims, iter, dimX, dimY, dimZ, methTV, printswitch, nonneg;
- const int *dim_array;
+ int number_of_dims, iter, methTV, printswitch, nonneg;
+ mwSize dimX, dimY, dimZ;
+ const mwSize *dim_array;
float *Input, *Output=NULL, lambda, epsil;
number_of_dims = mxGetNumberOfDimensions(prhs[0]);
diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_dTV.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_dTV.c
index bb868c7..1a0c070 100644
--- a/Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_dTV.c
+++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/FGP_dTV.c
@@ -49,9 +49,10 @@ void mexFunction(
int nrhs, const mxArray *prhs[])
{
- int number_of_dims, iter, dimX, dimY, dimZ, methTV, printswitch, nonneg;
- const int *dim_array;
- const int *dim_array2;
+ int number_of_dims, iter, methTV, printswitch, nonneg;
+ mwSize dimX, dimY, dimZ;
+ const mwSize *dim_array;
+ const mwSize *dim_array2;
float *Input, *InputRef, *Output=NULL, lambda, epsil, eta;
number_of_dims = mxGetNumberOfDimensions(prhs[0]);
diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/LLT_ROF.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/LLT_ROF.c
index 81b717d..ab45446 100644
--- a/Wrappers/Matlab/mex_compile/regularisers_CPU/LLT_ROF.c
+++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/LLT_ROF.c
@@ -46,8 +46,9 @@ void mexFunction(
int nrhs, const mxArray *prhs[])
{
- int number_of_dims, iterationsNumb, dimX, dimY, dimZ;
- const int *dim_array;
+ int number_of_dims, iterationsNumb;
+ mwSize dimX, dimY, dimZ;
+ const mwSize *dim_array;
float *Input, *Output=NULL, lambdaROF, lambdaLLT, tau;
dim_array = mxGetDimensions(prhs[0]);
diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff.c
index e05f5d4..ec35b8b 100644
--- a/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff.c
+++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff.c
@@ -43,8 +43,10 @@ void mexFunction(
int nrhs, const mxArray *prhs[])
{
- int number_of_dims, iter_numb, dimX, dimY, dimZ, penaltytype;
- const int *dim_array;
+ int number_of_dims, iter_numb, penaltytype;
+ mwSize dimX, dimY, dimZ;
+ const mwSize *dim_array;
+
float *Input, *Output=NULL, lambda, tau, sigma;
dim_array = mxGetDimensions(prhs[0]);
diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff_Inp.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff_Inp.c
index eaab4a7..9833392 100644
--- a/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff_Inp.c
+++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlDiff_Inp.c
@@ -45,9 +45,11 @@ void mexFunction(
int nrhs, const mxArray *prhs[])
{
- int number_of_dims, iter_numb, dimX, dimY, dimZ, penaltytype, i, inpaint_elements;
- const int *dim_array;
- const int *dim_array2;
+ int number_of_dims, iter_numb, penaltytype, i, inpaint_elements;
+ mwSize dimX, dimY, dimZ;
+ const mwSize *dim_array;
+ const mwSize *dim_array2;
+
float *Input, *Output=NULL, lambda, tau, sigma;
unsigned char *Mask;
@@ -95,7 +97,7 @@ void mexFunction(
}
inpaint_elements = 0;
- for (i=0; i<dimY*dimX*dimZ; i++) if (Mask[i] == 1) inpaint_elements++;
+ for (i=0; i<(int)(dimY*dimX*dimZ); i++) if (Mask[i] == 1) inpaint_elements++;
if (inpaint_elements == 0) mexErrMsgTxt("The mask is full of zeros, nothing to inpaint");
Diffusion_Inpaint_CPU_main(Input, Mask, Output, lambda, sigma, iter_numb, tau, penaltytype, dimX, dimY, dimZ);
} \ No newline at end of file
diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlocalMarching_Inpaint.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlocalMarching_Inpaint.c
index 36cf05c..b3f2c98 100644
--- a/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlocalMarching_Inpaint.c
+++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/NonlocalMarching_Inpaint.c
@@ -42,9 +42,11 @@ void mexFunction(
int nrhs, const mxArray *prhs[])
{
- int number_of_dims, dimX, dimY, dimZ, iterations, SW_increment;
- const int *dim_array;
- const int *dim_array2;
+ int number_of_dims, iterations, SW_increment;
+ mwSize dimX, dimY, dimZ;
+ const mwSize *dim_array;
+ const mwSize *dim_array2;
+
float *Input, *Output=NULL;
unsigned char *Mask, *Mask_upd=NULL;
diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/ROF_TV.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/ROF_TV.c
index ca484ba..55ef2b1 100644
--- a/Wrappers/Matlab/mex_compile/regularisers_CPU/ROF_TV.c
+++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/ROF_TV.c
@@ -44,7 +44,7 @@ void mexFunction(
int nrhs, const mxArray *prhs[])
{
- int number_of_dims, iter_numb, j;
+ int number_of_dims, iter_numb;
mwSize dimX, dimY, dimZ;
const mwSize *dim_array_i;
float *Input, *Output=NULL, lambda, tau;
@@ -61,25 +61,17 @@ void mexFunction(
if (mxGetClassID(prhs[0]) != mxSINGLE_CLASS) {mexErrMsgTxt("The input image must be in a single precision"); }
if(nrhs != 4) mexErrMsgTxt("Four inputs reqired: Image(2D,3D), regularization parameter, iterations number, marching step constant");
/*Handling Matlab output data*/
- dimX = dim_array_i[0]; dimY = dim_array_i[1]; dimZ = dim_array_i[2];
-
+ dimX = dim_array_i[0]; dimY = dim_array_i[1]; dimZ = dim_array_i[2];
/* output arrays*/
if (number_of_dims == 2) {
- //const mwSize dim_array[2] = {dimX, dimY};
dimZ = 1; /*2D case*/
/* output image/volume */
Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(2, dim_array_i, mxSINGLE_CLASS, mxREAL));
- //mexErrMsgTxt("Call me 72");
}
if (number_of_dims == 3) {
- //const mwSize dim_array[3] = {dimX, dimY, dimZ};
Output = (float*)mxGetPr(plhs[0] = mxCreateNumericArray(3, dim_array_i, mxSINGLE_CLASS, mxREAL));
}
-
-// for(j=0; j<(int)(dimX*dimY*dimZ); j++) {
-// if (j%10 == 0) mexErrMsgTxt("WHAT???");
-// Output[j] = 2;}
-
+
TV_ROF_CPU_main(Input, Output, lambda, iter_numb, tau, dimX, dimY, dimZ);
} \ No newline at end of file
diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/SB_TV.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/SB_TV.c
index d284cac..8636322 100644
--- a/Wrappers/Matlab/mex_compile/regularisers_CPU/SB_TV.c
+++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/SB_TV.c
@@ -42,8 +42,10 @@ void mexFunction(
int nrhs, const mxArray *prhs[])
{
- int number_of_dims, iter, dimX, dimY, dimZ, methTV, printswitch;
- const int *dim_array;
+ int number_of_dims, iter, methTV, printswitch;
+ mwSize dimX, dimY, dimZ;
+ const mwSize *dim_array;
+
float *Input, *Output=NULL, lambda, epsil;
number_of_dims = mxGetNumberOfDimensions(prhs[0]);
diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/TGV.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/TGV.c
index 9516869..5459bf5 100644
--- a/Wrappers/Matlab/mex_compile/regularisers_CPU/TGV.c
+++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/TGV.c
@@ -43,8 +43,10 @@ void mexFunction(
int nrhs, const mxArray *prhs[])
{
- int number_of_dims, iter, dimX, dimY;
- const int *dim_array;
+ int number_of_dims, iter;
+ mwSize dimX, dimY;
+ const mwSize *dim_array;
+
float *Input, *Output=NULL, lambda, alpha0, alpha1, L2;
number_of_dims = mxGetNumberOfDimensions(prhs[0]);
diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/TNV.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/TNV.c
index e0584c4..acea75d 100644
--- a/Wrappers/Matlab/mex_compile/regularisers_CPU/TNV.c
+++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/TNV.c
@@ -41,8 +41,9 @@ void mexFunction(
int nrhs, const mxArray *prhs[])
{
- int number_of_dims, iter, dimX, dimY, dimZ;
- const int *dim_array;
+ int number_of_dims, iter;
+ mwSize dimX, dimY, dimZ;
+ const mwSize *dim_array;
float *Input, *Output=NULL, lambda, epsil;
number_of_dims = mxGetNumberOfDimensions(prhs[0]);
diff --git a/Wrappers/Matlab/mex_compile/regularisers_CPU/TV_energy.c b/Wrappers/Matlab/mex_compile/regularisers_CPU/TV_energy.c
index f9eb2ce..d457f46 100644
--- a/Wrappers/Matlab/mex_compile/regularisers_CPU/TV_energy.c
+++ b/Wrappers/Matlab/mex_compile/regularisers_CPU/TV_energy.c
@@ -36,8 +36,10 @@ void mexFunction(
int nrhs, const mxArray *prhs[])
{
- int number_of_dims, dimX, dimY, dimZ, type;
- const int *dim_array;
+ int number_of_dims, type;
+
+ mwSize dimX, dimY, dimZ;
+ const mwSize *dim_array;
float *Input, *Input0, lambda;
number_of_dims = mxGetNumberOfDimensions(prhs[0]);