summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniil Kazantsev <dkazanc@hotmail.com>2019-03-12 22:14:27 +0000
committerDaniil Kazantsev <dkazanc@hotmail.com>2019-03-12 22:14:27 +0000
commit1ac06b5ce11b247930489b7aa3afa59215e43c91 (patch)
tree8a5dc7649b2fdeda67c8df9ff2ea2880596d9e67
parent420e71a0dcb42e91e1aa93306c2e2f688b309620 (diff)
downloadregularization-1ac06b5ce11b247930489b7aa3afa59215e43c91.tar.gz
regularization-1ac06b5ce11b247930489b7aa3afa59215e43c91.tar.bz2
regularization-1ac06b5ce11b247930489b7aa3afa59215e43c91.tar.xz
regularization-1ac06b5ce11b247930489b7aa3afa59215e43c91.zip
readme updates and demos
-rw-r--r--Readme.md31
-rwxr-xr-x[-rw-r--r--]build/run.sh23
-rw-r--r--demos/SoftwareX_supp/Demo_RealData_Recon_SX.py18
-rw-r--r--demos/demoMatlab_3Ddenoise.m16
-rwxr-xr-xrun.sh26
-rw-r--r--src/Matlab/mex_compile/compileGPU_mex.m5
-rw-r--r--src/Matlab/mex_compile/regularisers_CPU/PatchSelect.c4
7 files changed, 53 insertions, 70 deletions
diff --git a/Readme.md b/Readme.md
index cc96b2c..90c4f87 100644
--- a/Readme.md
+++ b/Readme.md
@@ -1,12 +1,11 @@
# CCPi-Regularisation Toolkit (CCPi-RGL)
-
-
| Master | Development | Anaconda binaries |
|--------|-------------|-------------------|
| [![Build Status](https://anvil.softeng-support.ac.uk/jenkins/buildStatus/icon?job=CILsingle/CCPi-Regularisation-Toolkit)](https://anvil.softeng-support.ac.uk/jenkins/job/CILsingle/job/CCPi-Regularisation-Toolkit/) | [![Build Status](https://anvil.softeng-support.ac.uk/jenkins/buildStatus/icon?job=CILsingle/CCPi-Regularisation-Toolkit-dev)](https://anvil.softeng-support.ac.uk/jenkins/job/CILsingle/job/CCPi-Regularisation-Toolkit-dev/) | ![conda version](https://anaconda.org/ccpi/ccpi-regulariser/badges/version.svg) ![conda last release](https://anaconda.org/ccpi/ccpi-regulariser/badges/latest_release_date.svg) [![conda platforms](https://anaconda.org/ccpi/ccpi-regulariser/badges/platforms.svg) ![conda dowloads](https://anaconda.org/ccpi/ccpi-regulariser/badges/downloads.svg)](https://anaconda.org/ccpi/ccpi-regulariser) |
-**Iterative image reconstruction (IIR) methods normally require regularisation to stabilise the convergence and make the reconstruction problem (inverse problem) more well-posed. The CCPi-RGL software provides 2D/3D and multi-channel regularisation strategies to ensure better performance of IIR methods. The regularisation modules are well-suited to use with [splitting algorithms](https://en.wikipedia.org/wiki/Augmented_Lagrangian_method#Alternating_direction_method_of_multipliers), such as, [ADMM](https://github.com/dkazanc/ADMM-tomo) and [FISTA](https://github.com/dkazanc/FISTA-tomo). Furthermore, the toolkit can be used for simpler inversion tasks, such as, image denoising, inpaiting, deconvolution etc. The core modules are written in C-OMP and CUDA languages and wrappers for Matlab and Python are provided.**
+**Iterative image reconstruction (IIR) methods frequently require regularisation to ensure convergence and make inverse problem well-posed. The CCPi-RGL toolkit provides a set of 2D/3D regularisation strategies to guarantee a better performance of IIR methods (higher SNR and resolution). The regularisation modules for scalar and vectorial datasets are based on the [proximal operator](https://en.wikipedia.org/wiki/Proximal_operator) framework and can be used with [proximal splitting algorithms](https://en.wikipedia.org/wiki/Proximal_gradient_method), such as PDHG, Douglas-Rachford, ADMM, FISTA and [others](https://arxiv.org/abs/0912.3522). While the main target for CCPi-RGL is [tomographic image reconstruction](https://github.com/dkazanc/TomoRec), the toolkit can be used for image denoising and inpaiting problems. The core modules are written in C-OMP and CUDA languages and wrappers for Matlab and Python are provided.**
+
<div align="center">
<img src="demos/images/probl.png" height="225"><br>
@@ -20,7 +19,7 @@
<img src="demos/images/TV_vs_NLTV.jpg" height="300"><br>
</div>
-## Prerequisites:
+## Prerequisites:
* [MATLAB](www.mathworks.com/products/matlab/) OR
* Python (tested ver. 3.5/2.7); Cython
@@ -29,7 +28,7 @@
## Package modules:
-### Single-channel (denoising):
+### Single-channel (scalar):
1. Rudin-Osher-Fatemi (ROF) Total Variation (explicit PDE minimisation scheme) **2D/3D CPU/GPU** (Ref. *1*)
2. Fast-Gradient-Projection (FGP) Total Variation **2D/3D CPU/GPU** (Ref. *2*)
3. Split-Bregman (SB) Total Variation **2D/3D CPU/GPU** (Ref. *5*)
@@ -39,7 +38,7 @@
7. A joint ROF-LLT (Lysaker-Lundervold-Tai) model for higher-order regularisation **2D/3D CPU/GPU** (Ref. *10,11*)
8. Nonlocal Total Variation regularisation (GS fixed point iteration) **2D CPU/GPU** (Ref. *12*)
-### Multi-channel (denoising):
+### Multi-channel (vectorial):
1. Fast-Gradient-Projection (FGP) Directional Total Variation **2D/3D CPU/GPU** (Ref. *3,4,2*)
2. Total Nuclear Variation (TNV) penalty **2D+channels CPU** (Ref. *7*)
@@ -68,10 +67,10 @@ build/jenkins-build.sh
this will install `conda build` environment and compiles C/C++ and Python wrappers and performs basic tests for environment with python 3.6 and numpy 1.12.
### CMake
-If you want to build directly using cmake, install CMake (v.>=3) to configure it. Additionally you will need a C compiler, `make` (on linux) and CUDA SDK where available. The toolkit may be used directly from C/C++ as it is compiled as a shared library (check-out the include files in `Core` for this)
-1. Clone this repository to a directory, i.e. `CCPi-Regularisation-Toolkit`,
-2. create a build directory.
-3. Issue `cmake` to configure (or `cmake-gui`, or `ccmake`, or `cmake3`). Use additional flags to fine tune the configuration.
+If you want to build directly using cmake, install CMake (v.>=3) to configure it. Additionally you will need a C compiler, `make` (on linux) and CUDA SDK where available. The toolkit may be used directly from C/C++ as it is compiled as a shared library (check-out the include files in `Core` for this)
+1. Clone this repository to a directory, i.e. `CCPi-Regularisation-Toolkit`,
+2. create a build directory.
+3. Issue `cmake` to configure (or `cmake-gui`, or `ccmake`, or `cmake3`). Use additional flags to fine tune the configuration.
Flags used during configuration
@@ -119,7 +118,7 @@ conda install ccpi-regulariser -c ccpi -c conda-forge
#### Python build
-If passed `CONDA_BUILD=ON` the software will be installed by issuing `python setup.py install` which will install in the system python (or whichever other python it's been picked up by CMake at configuration time.)
+If passed `CONDA_BUILD=ON` the software will be installed by issuing `python setup.py install` which will install in the system python (or whichever other python it's been picked up by CMake at configuration time.)
If passed `CONDA_BUILD=OFF` the software will be installed in the directory pointed by `${PYTHON_DEST_DIR}` which defaults to `${CMAKE_INSTALL_PREFIX}/python`. Therefore this directory should be added to the `PYTHONPATH`.
If Python is not picked by CMake you can provide the additional flag to CMake `-DPYTHON_EXECUTABLE=/path/to/python/executable`.
@@ -128,12 +127,12 @@ If Python is not picked by CMake you can provide the additional flag to CMake `-
Matlab wrapper will install in the `${MATLAB_DEST_DIR}` directory, which defaults to `${CMAKE_INSTALL_PREFIX}/matlab`
-If Matlab is not picked by CMake, you could add `-DMatlab_ROOT_DIR=<Matlab directory>`.
+If Matlab is not picked by CMake, you could add `-DMatlab_ROOT_DIR=<Matlab directory>`.
#### Linux
Because you've installed the modules in `<your favourite install directory>` you need to instruct Matlab to look in those directories:
-```bash
+```bash
PATH="/path/to/mex/:$PATH" LD_LIBRARY_PATH="/path/to/library:$LD_LIBRARY_PATH" matlab
```
@@ -147,8 +146,8 @@ addpath(/path/to/library);
#### Legacy Matlab installation (partly supported, please use Cmake)
```
-
- cd /Wrappers/Matlab/mex_compile
+
+ cd src/Matlab/mex_compile
compileCPU_mex.m % to compile CPU modules
compileGPU_mex.m % to compile GPU modules (see instructions in the file)
```
@@ -179,7 +178,7 @@ addpath(/path/to/library);
12. [Abderrahim E., Lezoray O. and Bougleux S. 2008. Nonlocal discrete regularization on weighted graphs: a framework for image and manifold processing." IEEE Trans. Image Processing 17(7), pp. 1047-1060.](https://ieeexplore.ieee.org/document/4526700)
### References to Software:
-* If software is used, please refer to [11], however, the supporting publication is in progress.
+* If software is used, please refer to [11], however, the supporting publication is in progress.
### Applications:
diff --git a/build/run.sh b/build/run.sh
index d450299..f2869e5 100644..100755
--- a/build/run.sh
+++ b/build/run.sh
@@ -5,20 +5,23 @@ rm -r build_proj
# pip install cython
mkdir build_proj
cd build_proj/
-make clean
+#make clean
export CIL_VERSION=19.03
# install Python modules without CUDA
cmake ../ -DBUILD_PYTHON_WRAPPER=ON -DBUILD_MATLAB_WRAPPER=OFF -DBUILD_CUDA=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install
# install Python modules with CUDA
# cmake ../ -DBUILD_PYTHON_WRAPPER=ON -DBUILD_MATLAB_WRAPPER=OFF -DBUILD_CUDA=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install
+# install Matlab modules without CUDA
+#cmake ../ -DBUILD_PYTHON_WRAPPER=OFF -DMatlab_ROOT_DIR=/dls_sw/apps/matlab/r2014a/ -DBUILD_MATLAB_WRAPPER=ON -DBUILD_CUDA=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install
# install Matlab modules with CUDA
-# cmake ../ -DBUILD_PYTHON_WRAPPER=OFF -DMatlab_ROOT_DIR=/dls_sw/apps/matlab/r2014a/ -DBUILD_MATLAB_WRAPPER=ON -DBUILD_CUDA=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install
-make install
-#### Python
+#cmake ../ -DBUILD_PYTHON_WRAPPER=OFF -DMatlab_ROOT_DIR=/dls_sw/apps/matlab/r2014a/ -DBUILD_MATLAB_WRAPPER=ON -DBUILD_CUDA=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install
+############### Python(linux)###############
#cp install/lib/libcilreg.so install/python/ccpi/filters
-cd install/python
-export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:../lib
-spyder
-##### one can also run Matlab in Linux as:
-#PATH="/path/to/mex/:$PATH" LD_LIBRARY_PATH="/path/to/library:$LD_LIBRARY_PATH" matlab
-#PATH="/home/kjy41806/Documents/SOFT/CCPi-Regularisation-Toolkit/build/install/matlab/:$PATH" LD_LIBRARY_PATH="/home/kjy41806/Documents/SOFT/CCPi-Regularisation-Toolkit/build/install/lib:$LD_LIBRARY_PATH" matlab
+# cd install/python
+# export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:../lib
+# spyder
+############### Matlab(linux)###############
+### export LD_PRELOAD=/home/algol/anaconda3/lib/libstdc++.so.6 # if there is libstdc error in matlab
+# PATH="/path/to/mex/:$PATH" LD_LIBRARY_PATH="/path/to/library:$LD_LIBRARY_PATH" matlab
+# PATH="/home/kjy41806/Documents/SOFT/CCPi-Regularisation-Toolkit/build_proj/install/matlab/:$PATH" LD_LIBRARY_PATH="/home/kjy41806/Documents/SOFT/CCPi-Regularisation-Toolkit/build_proj/install/lib:$LD_LIBRARY_PATH" matlab
+# PATH="/home/algol/Documents/DEV/CCPi-Regularisation-Toolkit/build_proj/install/matlab/:$PATH" LD_LIBRARY_PATH="/home/algol/Documents/DEV/CCPi-Regularisation-Toolkit/build_proj/install/lib:$LD_LIBRARY_PATH" /home/algol/SOFT/MATLAB9/bin/matlab
diff --git a/demos/SoftwareX_supp/Demo_RealData_Recon_SX.py b/demos/SoftwareX_supp/Demo_RealData_Recon_SX.py
index ca8f1d2..5991989 100644
--- a/demos/SoftwareX_supp/Demo_RealData_Recon_SX.py
+++ b/demos/SoftwareX_supp/Demo_RealData_Recon_SX.py
@@ -1,15 +1,15 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
-This demo scripts support the following publication:
-"CCPi-Regularisation Toolkit for computed tomographic image reconstruction with
+This demo scripts support the following publication:
+"CCPi-Regularisation Toolkit for computed tomographic image reconstruction with
proximal splitting algorithms" by Daniil Kazantsev, Edoardo Pasca, Martin J. Turner,
Philip J. Withers; Software X, 2019
____________________________________________________________________________
* Reads real tomographic data (stored at Zenodo)
--- https://doi.org/10.5281/zenodo.2578893
* Reconstructs using TomoRec software
-* Saves reconstructed images
+* Saves reconstructed images
____________________________________________________________________________
>>>>> Dependencies: <<<<<
1. ASTRA toolbox: conda install -c astra-toolbox astra-toolbox
@@ -40,7 +40,7 @@ data_norm = normaliser(dataRaw, flats, darks, log='log')
del dataRaw, darks, flats
intens_max = 2.3
-plt.figure()
+plt.figure()
plt.subplot(131)
plt.imshow(data_norm[:,150,:],vmin=0, vmax=intens_max)
plt.title('2D Projection (analytical)')
@@ -72,7 +72,7 @@ FBPrec = RectoolsDIR.FBP(data_norm[0:100,:,det_y_crop])
sliceSel = 50
max_val = 0.003
-plt.figure()
+plt.figure()
plt.subplot(131)
plt.imshow(FBPrec[sliceSel,:,:],vmin=0, vmax=max_val, cmap="gray")
plt.title('FBP Reconstruction, axial view')
@@ -108,7 +108,7 @@ RectoolsIR = RecToolsIR(DetectorsDimH = np.size(det_y_crop), # DetectorsDimH #
DetectorsDimV = 100, # DetectorsDimV # detector dimension (vertical) for 3D case only
AnglesVec = angles_rad, # array of angles in radians
ObjSize = N_size, # a scalar to define reconstructed object dimensions
- datafidelity='LS',# data fidelity, choose LS, PWLS (wip), GH (wip), Student (wip)
+ datafidelity='LS',# data fidelity, choose LS, PWLS, GH (wip), Students t (wip)
nonnegativity='ENABLE', # enable nonnegativity constraint (set to 'ENABLE')
OS_number = None, # the number of subsets, NONE/(or > 1) ~ classical / ordered subsets
tolerance = 0.0, # tolerance to stop inner (regularisation) iterations earlier
@@ -124,7 +124,7 @@ RecADMM_reg_sbtv = RectoolsIR.ADMM(data_norm[0:100,:,det_y_crop],
sliceSel = 50
max_val = 0.003
-plt.figure()
+plt.figure()
plt.subplot(131)
plt.imshow(RecADMM_reg_sbtv[sliceSel,:,:],vmin=0, vmax=max_val, cmap="gray")
plt.title('3D ADMM-SB-TV Reconstruction, axial view')
@@ -164,7 +164,7 @@ RecADMM_reg_rofllt = RectoolsIR.ADMM(data_norm[0:100,:,det_y_crop],
sliceSel = 50
max_val = 0.003
-plt.figure()
+plt.figure()
plt.subplot(131)
plt.imshow(RecADMM_reg_rofllt[sliceSel,:,:],vmin=0, vmax=max_val)
plt.title('3D ADMM-ROFLLT Reconstruction, axial view')
@@ -202,7 +202,7 @@ RecADMM_reg_tgv = RectoolsIR.ADMM(data_norm[0:100,:,det_y_crop],
sliceSel = 50
max_val = 0.003
-plt.figure()
+plt.figure()
plt.subplot(131)
plt.imshow(RecADMM_reg_tgv[sliceSel,:,:],vmin=0, vmax=max_val)
plt.title('3D ADMM-TGV Reconstruction, axial view')
diff --git a/demos/demoMatlab_3Ddenoise.m b/demos/demoMatlab_3Ddenoise.m
index ec0fd88..6b21e86 100644
--- a/demos/demoMatlab_3Ddenoise.m
+++ b/demos/demoMatlab_3Ddenoise.m
@@ -18,9 +18,10 @@ Ideal3D(:,:,i) = Im;
end
vol3D(vol3D < 0) = 0;
figure; imshow(vol3D(:,:,7), [0 1]); title('Noisy image');
-lambda_reg = 0.03; % regularsation parameter for all methods
+
%%
fprintf('Denoise a volume using the ROF-TV model (CPU) \n');
+lambda_reg = 0.03; % regularsation parameter for all methods
tau_rof = 0.0025; % time-marching constant
iter_rof = 300; % number of ROF iterations
epsil_tol = 0.0; % tolerance
@@ -31,14 +32,17 @@ fprintf('%s %f \n', 'RMSE error for ROF is:', rmse_rof);
figure; imshow(u_rof(:,:,7), [0 1]); title('ROF-TV denoised volume (CPU)');
%%
% fprintf('Denoise a volume using the ROF-TV model (GPU) \n');
+% lambda_reg = 0.03; % regularsation parameter for all methods
% tau_rof = 0.0025; % time-marching constant
% iter_rof = 300; % number of ROF iterations
-% tic; u_rofG = ROF_TV_GPU(single(vol3D), lambda_reg, iter_rof, tau_rof); toc;
+% epsil_tol = 0.0; % tolerance
+% tic; u_rofG = ROF_TV_GPU(single(vol3D), lambda_reg, iter_rof, tau_rof, epsil_tol); toc;
% rmse_rofG = (RMSE(Ideal3D(:),u_rofG(:)));
% fprintf('%s %f \n', 'RMSE error for ROF is:', rmse_rofG);
% figure; imshow(u_rofG(:,:,7), [0 1]); title('ROF-TV denoised volume (GPU)');
%%
fprintf('Denoise a volume using the FGP-TV model (CPU) \n');
+lambda_reg = 0.03; % regularsation parameter for all methods
iter_fgp = 300; % number of FGP iterations
epsil_tol = 0.0; % tolerance
tic; [u_fgp,infovec] = FGP_TV(single(vol3D), lambda_reg, iter_fgp, epsil_tol); toc;
@@ -47,9 +51,10 @@ rmse_fgp = (RMSE(Ideal3D(:),u_fgp(:)));
fprintf('%s %f \n', 'RMSE error for FGP-TV is:', rmse_fgp);
figure; imshow(u_fgp(:,:,7), [0 1]); title('FGP-TV denoised volume (CPU)');
%%
-% fprintf('Denoise a volume using the FGP-TV model (GPU) \n');
+fprintf('Denoise a volume using the FGP-TV model (GPU) \n');
+% lambda_reg = 0.03; % regularsation parameter for all methods
% iter_fgp = 300; % number of FGP iterations
-% epsil_tol = 1.0e-05; % tolerance
+% epsil_tol = 0.0; % tolerance
% tic; u_fgpG = FGP_TV_GPU(single(vol3D), lambda_reg, iter_fgp, epsil_tol); toc;
% rmse_fgpG = (RMSE(Ideal3D(:),u_fgpG(:)));
% fprintf('%s %f \n', 'RMSE error for FGP-TV is:', rmse_fgpG);
@@ -66,7 +71,7 @@ figure; imshow(u_sb(:,:,7), [0 1]); title('SB-TV denoised volume (CPU)');
%%
% fprintf('Denoise a volume using the SB-TV model (GPU) \n');
% iter_sb = 150; % number of SB iterations
-% epsil_tol = 1.0e-05; % tolerance
+% epsil_tol = 0.0; % tolerance
% tic; u_sbG = SB_TV_GPU(single(vol3D), lambda_reg, iter_sb, epsil_tol); toc;
% rmse_sbG = (RMSE(Ideal3D(:),u_sbG(:)));
% fprintf('%s %f \n', 'RMSE error for SB-TV is:', rmse_sbG);
@@ -88,6 +93,7 @@ figure; imshow(u_rof_llt(:,:,7), [0 1]); title('ROF-LLT denoised volume (CPU)');
% lambda_LLT = lambda_reg*0.35; % LLT regularisation parameter
% iter_LLT = 300; % iterations
% tau_rof_llt = 0.0025; % time-marching constant
+% epsil_tol = 0.0; % tolerance
% tic; u_rof_llt_g = LLT_ROF_GPU(single(vol3D), lambda_ROF, lambda_LLT, iter_LLT, tau_rof_llt, epsil_tol); toc;
% rmse_rof_llt = (RMSE(Ideal3D(:),u_rof_llt_g(:)));
% fprintf('%s %f \n', 'RMSE error for ROF-LLT is:', rmse_rof_llt);
diff --git a/run.sh b/run.sh
deleted file mode 100755
index 7700603..0000000
--- a/run.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-echo "Building CCPi-regularisation Toolkit using CMake"
-rm -r build_proj
-# Requires Cython, install it first:
-# pip install cython
-mkdir build_proj
-cd build_proj/
-#make clean
-export CIL_VERSION=19.03
-# install Python modules without CUDA
-# cmake ../ -DBUILD_PYTHON_WRAPPER=ON -DBUILD_MATLAB_WRAPPER=OFF -DBUILD_CUDA=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install
-# install Python modules with CUDA
-# cmake ../ -DBUILD_PYTHON_WRAPPER=ON -DBUILD_MATLAB_WRAPPER=OFF -DBUILD_CUDA=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install
-# install Matlab modules without CUDA
-#cmake ../ -DBUILD_PYTHON_WRAPPER=OFF -DMatlab_ROOT_DIR=/dls_sw/apps/matlab/r2014a/ -DBUILD_MATLAB_WRAPPER=ON -DBUILD_CUDA=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install
-# install Matlab modules with CUDA
-cmake ../ -DBUILD_PYTHON_WRAPPER=OFF -DMatlab_ROOT_DIR=/dls_sw/apps/matlab/r2014a/ -DBUILD_MATLAB_WRAPPER=ON -DBUILD_CUDA=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install
-make install
-#### Python
-#cp install/lib/libcilreg.so install/python/ccpi/filters
-# cd install/python
-# export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:../lib
-# spyder
-##### Matlab (Linux)
-#PATH="/path/to/mex/:$PATH" LD_LIBRARY_PATH="/path/to/library:$LD_LIBRARY_PATH" matlab
-PATH="/home/kjy41806/Documents/SOFT/CCPi-Regularisation-Toolkit/build_proj/install/matlab/:$PATH" LD_LIBRARY_PATH="/home/kjy41806/Documents/SOFT/CCPi-Regularisation-Toolkit/build_proj/install/lib:$LD_LIBRARY_PATH" matlab
diff --git a/src/Matlab/mex_compile/compileGPU_mex.m b/src/Matlab/mex_compile/compileGPU_mex.m
index 3a7ac7c..7e15233 100644
--- a/src/Matlab/mex_compile/compileGPU_mex.m
+++ b/src/Matlab/mex_compile/compileGPU_mex.m
@@ -4,7 +4,7 @@
% In order to compile CUDA modules one needs to have nvcc-compiler
% installed (see CUDA SDK), check it under MATLAB with !nvcc --version
-% In the code bellow we provide a full explicit path to nvcc compiler
+% In the code bellow we provide a full explicit path to nvcc compiler
% ! paths to matlab and CUDA sdk can be different, modify accordingly !
% Tested on Ubuntu 18.04/MATLAB 2016b/cuda10.0/gcc7.3
@@ -68,7 +68,8 @@ movefile('LLT_ROF_GPU.mex*',Pathmove);
delete TV_ROF_GPU_core* TV_FGP_GPU_core* TV_SB_GPU_core* dTV_FGP_GPU_core* NonlDiff_GPU_core* Diffus_4thO_GPU_core* TGV_GPU_core* LLT_ROF_GPU_core* CCPiDefines.h
+delete PatchSelect_core* Nonlocal_TV_core* shared.h
fprintf('%s \n', 'All successfully compiled!');
pathA2 = sprintf(['..' fsep '..' fsep '..' fsep '..' fsep 'demos'], 1i);
-cd(pathA2); \ No newline at end of file
+cd(pathA2);
diff --git a/src/Matlab/mex_compile/regularisers_CPU/PatchSelect.c b/src/Matlab/mex_compile/regularisers_CPU/PatchSelect.c
index d2f6670..1acab29 100644
--- a/src/Matlab/mex_compile/regularisers_CPU/PatchSelect.c
+++ b/src/Matlab/mex_compile/regularisers_CPU/PatchSelect.c
@@ -52,8 +52,8 @@ void mexFunction(
{
int number_of_dims, SearchWindow, SimilarWin, NumNeighb;
mwSize dimX, dimY, dimZ;
- unsigned short *H_i=NULL, *H_j=NULL, *H_k=NULL;
- mwSize *dim_array;
+ const mwSize *dim_array;
+ unsigned short *H_i=NULL, *H_j=NULL, *H_k=NULL;
float *A, *Weights = NULL, h;
mwSize dim_array2[3]; /* for 2D data */
mwSize dim_array3[4]; /* for 3D data */