diff options
author | vagrant <vagrant@localhost.localdomain> | 2019-01-28 11:50:20 +0000 |
---|---|---|
committer | vagrant <vagrant@localhost.localdomain> | 2019-01-28 11:50:20 +0000 |
commit | 0d74c50c48ae518fedb44e5d04a148eaa02b485b (patch) | |
tree | 9e000d8a05a58d101cd838f9d914bbeb9dcee537 | |
parent | a293e77c132f8eaa2b1dd52ae9b926b90f72cfd0 (diff) | |
parent | 4aa979cd6cd0e437ab5cc02367adf140d63030b6 (diff) | |
download | regularization-0d74c50c48ae518fedb44e5d04a148eaa02b485b.tar.gz regularization-0d74c50c48ae518fedb44e5d04a148eaa02b485b.tar.bz2 regularization-0d74c50c48ae518fedb44e5d04a148eaa02b485b.tar.xz regularization-0d74c50c48ae518fedb44e5d04a148eaa02b485b.zip |
Merge branch 'master' of https://github.com/vais-ral/CCPi-Regularisation-Toolkit
Conflicts:
build/jenkins-build.sh
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | Core/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Core/regularisers_CPU/TGV_core.c | 3 | ||||
-rw-r--r-- | Core/regularisers_GPU/PatchSelect_GPU_core.cu | 4 | ||||
-rwxr-xr-x | Core/regularisers_GPU/TV_FGP_GPU_core.h | 9 | ||||
-rwxr-xr-x | Core/regularisers_GPU/TV_SB_GPU_core.h | 10 | ||||
-rw-r--r-- | Core/regularisers_GPU/dTV_FGP_GPU_core.h | 9 | ||||
-rw-r--r-- | Readme.md | 3 | ||||
-rw-r--r-- | Wrappers/Python/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Wrappers/Python/conda-recipe/build.sh | 1 | ||||
-rw-r--r-- | Wrappers/Python/conda-recipe/conda_build_config.yaml | 7 | ||||
-rw-r--r-- | Wrappers/Python/conda-recipe/meta.yaml | 14 | ||||
-rw-r--r-- | recipes/regularisers/build.sh | 2 |
13 files changed, 45 insertions, 26 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 550b896..b95107a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,10 @@ set (CIL_VERSION_MAJOR 0) set (CIL_VERSION_MINOR 10) set (CIL_VERSION_PATCH 2) -set (CIL_VERSION '${CIL_VERSION_MAJOR}.${CIL_VERSION_MINOR}.${CIL_VERSION_PATCH}' CACHE INTERNAL "Core Imaging Library version" FORCE) +# set (CIL_VERSION '${CIL_VERSION_MAJOR}.${CIL_VERSION_MINOR}.${CIL_VERSION_PATCH}' CACHE INTERNAL "Core Imaging Library version" FORCE) +# get CIL_VERSION from environment variable and set it in cmake +set (CIL_VERSION $ENV{CIL_VERSION} CACHE INTERNAL "Core Imaging Library version" FORCE) +message(STATUS "CIL_VERSION set to " ${CIL_VERSION}) # set the Python variables for the Conda environment #include(${CMAKE_SOURCE_DIR}/CMake/FindAnacondaEnvironment.cmake) diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index d92db82..b3c0dfb 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -6,7 +6,7 @@ project(RGL_core) # The version number. -#set (CIL_VERSION $ENV{CIL_VERSION} CACHE INTERNAL "Core Imaging Library version" FORCE) +set (CIL_VERSION $ENV{CIL_VERSION} CACHE INTERNAL "Core Imaging Library version" FORCE) # conda orchestrated build message("CIL_VERSION ${CIL_VERSION}") diff --git a/Core/regularisers_CPU/TGV_core.c b/Core/regularisers_CPU/TGV_core.c index edd77b2..477e909 100644 --- a/Core/regularisers_CPU/TGV_core.c +++ b/Core/regularisers_CPU/TGV_core.c @@ -100,6 +100,9 @@ float TGV_main(float *U0, float *U, float lambda, float alpha1, float alpha0, in newU(V1, V1_old, (long)(dimX), (long)(dimY)); newU(V2, V2_old, (long)(dimX), (long)(dimY)); } /*end of iterations*/ + /*freeing*/ + free(P1);free(P2);free(Q1);free(Q2);free(Q3);free(U_old); + free(V1);free(V2);free(V1_old);free(V2_old); return *U; } diff --git a/Core/regularisers_GPU/PatchSelect_GPU_core.cu b/Core/regularisers_GPU/PatchSelect_GPU_core.cu index d173124..98c8488 100644 --- a/Core/regularisers_GPU/PatchSelect_GPU_core.cu +++ b/Core/regularisers_GPU/PatchSelect_GPU_core.cu @@ -449,10 +449,12 @@ extern "C" int PatchSelect_GPU_main(float *A, unsigned short *H_i, unsigned shor checkCudaErrors(cudaMemcpy(H_j, H_j_d, N*M*NumNeighb*sizeof(unsigned short),cudaMemcpyDeviceToHost) ); checkCudaErrors(cudaMemcpy(Weights, Weights_d, N*M*NumNeighb*sizeof(float),cudaMemcpyDeviceToHost) ); + cudaFree(Ad); cudaFree(H_i_d); cudaFree(H_j_d); - cudaFree(Weights_d); + cudaFree(Weights_d); cudaFree(Eucl_Vec_d); + cudaDeviceReset(); return 0; } diff --git a/Core/regularisers_GPU/TV_FGP_GPU_core.h b/Core/regularisers_GPU/TV_FGP_GPU_core.h index b28cdf3..bf13508 100755 --- a/Core/regularisers_GPU/TV_FGP_GPU_core.h +++ b/Core/regularisers_GPU/TV_FGP_GPU_core.h @@ -1,10 +1,9 @@ -#include <stdio.h> -#include <stdlib.h> -#include <memory.h> - #ifndef _TV_FGP_GPU_ #define _TV_FGP_GPU_ -extern "C" int TV_FGP_GPU_main(float *Input, float *Output, float lambdaPar, int iter, float epsil, int methodTV, int nonneg, int printM, int dimX, int dimY, int dimZ); +#include "CCPiDefines.h" +#include <memory.h> + +extern "C" CCPI_EXPORT int TV_FGP_GPU_main(float *Input, float *Output, float lambdaPar, int iter, float epsil, int methodTV, int nonneg, int printM, int dimX, int dimY, int dimZ); #endif diff --git a/Core/regularisers_GPU/TV_SB_GPU_core.h b/Core/regularisers_GPU/TV_SB_GPU_core.h index d44ab77..901b90f 100755 --- a/Core/regularisers_GPU/TV_SB_GPU_core.h +++ b/Core/regularisers_GPU/TV_SB_GPU_core.h @@ -1,10 +1,10 @@ -#include <stdio.h> -#include <stdlib.h> -#include <memory.h> - #ifndef _SB_TV_GPU_ #define _SB_TV_GPU_ -extern "C" int TV_SB_GPU_main(float *Input, float *Output, float mu, int iter, float epsil, int methodTV, int printM, int dimX, int dimY, int dimZ); +#include "CCPiDefines.h" +#include <memory.h> + + +extern "C" CCPI_EXPORT int TV_SB_GPU_main(float *Input, float *Output, float mu, int iter, float epsil, int methodTV, int printM, int dimX, int dimY, int dimZ); #endif diff --git a/Core/regularisers_GPU/dTV_FGP_GPU_core.h b/Core/regularisers_GPU/dTV_FGP_GPU_core.h index 9020b1a..f9281e8 100644 --- a/Core/regularisers_GPU/dTV_FGP_GPU_core.h +++ b/Core/regularisers_GPU/dTV_FGP_GPU_core.h @@ -1,10 +1,9 @@ -#include <stdio.h> -#include <stdlib.h> -#include <memory.h> - #ifndef _dTV_FGP_GPU_ #define _dTV_FGP_GPU_ -extern "C" int dTV_FGP_GPU_main(float *Input, float *InputRef, float *Output, float lambdaPar, int iter, float epsil, float eta, int methodTV, int nonneg, int printM, int dimX, int dimY, int dimZ); +#include "CCPiDefines.h" +#include <memory.h> + +extern "C" CCPI_EXPORT int dTV_FGP_GPU_main(float *Input, float *InputRef, float *Output, float lambdaPar, int iter, float epsil, float eta, int methodTV, int nonneg, int printM, int dimX, int dimY, int dimZ); #endif @@ -1,3 +1,6 @@ +| Master | Development | +|--------|-------------| +| [![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/) | # CCPi-Regularisation Toolkit (CCPi-RGL) **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.** diff --git a/Wrappers/Python/CMakeLists.txt b/Wrappers/Python/CMakeLists.txt index d86d0ea..c2ef855 100644 --- a/Wrappers/Python/CMakeLists.txt +++ b/Wrappers/Python/CMakeLists.txt @@ -9,7 +9,7 @@ project(regulariserPython) #set (CIL_VERSION $ENV{CIL_VERSION} CACHE INTERNAL "Core Imaging Library version" FORCE) # conda orchestrated build -message("CIL_VERSION ${CIL_VERSION}") +message("CIL_VERSION: ${CIL_VERSION}") #include (GenerateExportHeader) find_package(PythonInterp REQUIRED) diff --git a/Wrappers/Python/conda-recipe/build.sh b/Wrappers/Python/conda-recipe/build.sh index eec7c2f..39c0f2c 100644 --- a/Wrappers/Python/conda-recipe/build.sh +++ b/Wrappers/Python/conda-recipe/build.sh @@ -5,6 +5,7 @@ cp -rv "$RECIPE_DIR/../../../Core" "$SRC_DIR/Core" cd $SRC_DIR ##cuda=off + cmake -G "Unix Makefiles" $RECIPE_DIR/../../../ -DBUILD_PYTHON_WRAPPER=ON -DCONDA_BUILD=ON -DBUILD_CUDA=ON -DCMAKE_BUILD_TYPE="Release" -DLIBRARY_LIB=$CONDA_PREFIX/lib -DLIBRARY_INC=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$PREFIX diff --git a/Wrappers/Python/conda-recipe/conda_build_config.yaml b/Wrappers/Python/conda-recipe/conda_build_config.yaml new file mode 100644 index 0000000..b7977f3 --- /dev/null +++ b/Wrappers/Python/conda-recipe/conda_build_config.yaml @@ -0,0 +1,7 @@ +python: + - 2.7 # [not win] + - 3.5 + - 3.6 +numpy: + - 1.12 + - 1.15 diff --git a/Wrappers/Python/conda-recipe/meta.yaml b/Wrappers/Python/conda-recipe/meta.yaml index 808493e..9dd5544 100644 --- a/Wrappers/Python/conda-recipe/meta.yaml +++ b/Wrappers/Python/conda-recipe/meta.yaml @@ -1,22 +1,23 @@ package: name: ccpi-regulariser - version: 0.10.3 - - + version: {{CIL_VERSION}} + build: preserve_egg_dir: False number: 0 + script_env: + - CIL_VERSION test: files: - lena_gray_512.tif requires: - - pillow + - pillow=4.1.1 requirements: build: - python - - numpy x.x + - numpy {{ numpy }} - setuptools - cython - vc 14 # [win and py36] @@ -25,8 +26,9 @@ requirements: - cmake run: + - {{ pin_compatible('numpy', max_pin='x.x') }} - python - - numpy x.x + - numpy - vc 14 # [win and py36] - vc 14 # [win and py35] - vc 9 # [win and py27] diff --git a/recipes/regularisers/build.sh b/recipes/regularisers/build.sh index 0b8bce2..eaa778e 100644 --- a/recipes/regularisers/build.sh +++ b/recipes/regularisers/build.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -echo $CIL_VERSION +echo build.sh CIL_VERSION: $CIL_VERSION #if [ -z "$CIL_VERSION" ]; then # echo "Need to set CIL_VERSION" # exit 1 |