summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Core/CMakeLists.txt8
-rw-r--r--Core/regularizers_CPU/FGP_TV_core.h21
-rw-r--r--Core/regularizers_CPU/LLT_model_core.h13
-rw-r--r--Core/regularizers_CPU/PatchBased_Regul_core.h7
-rw-r--r--Core/regularizers_CPU/SplitBregman_TV_core.h17
-rw-r--r--Core/regularizers_CPU/TGV_PD_core.h15
-rw-r--r--Core/regularizers_CPU/utils.h3
-rw-r--r--Core/regularizers_GPU/Diffus_HO/Diff4th_GPU_kernel.h3
-rw-r--r--Core/regularizers_GPU/NL_Regul/NLM_GPU_kernel.h3
9 files changed, 53 insertions, 37 deletions
diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt
index 5f443b7..97f8a54 100644
--- a/Core/CMakeLists.txt
+++ b/Core/CMakeLists.txt
@@ -10,6 +10,7 @@ set (CIL_VERSION $ENV{CIL_VERSION} CACHE INTERNAL "Core Imaging Library version"
# conda orchestrated build
message("CIL_VERSION ${CIL_VERSION}")
+#include (GenerateExportHeader)
find_package(PythonInterp REQUIRED)
if (PYTHONINTERP_FOUND)
@@ -76,7 +77,14 @@ add_library(cilreg SHARED
target_link_libraries(cilreg ${EXTRA_LIBRARIES} )
include_directories(cilreg PUBLIC
${LIBRARY_INC}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/regularizers_CPU/ )
+#GENERATE_EXPORT_HEADER( cilreg
+# BASE_NAME cilreg
+# EXPORT_MACRO_NAME CCPiCore_EXPORTS
+# EXPORT_FILE_NAME CCPiCore_Exports.h
+# STATIC_DEFINE cilreg_BUILT_AS_STATIC
+#)
if (UNIX)
message ("I'd install into ${CMAKE_INSTALL_PREFIX}/lib")
install(TARGETS cilreg
diff --git a/Core/regularizers_CPU/FGP_TV_core.h b/Core/regularizers_CPU/FGP_TV_core.h
index 6430bf2..10ea224 100644
--- a/Core/regularizers_CPU/FGP_TV_core.h
+++ b/Core/regularizers_CPU/FGP_TV_core.h
@@ -24,6 +24,7 @@ limitations under the License.
#include <stdio.h>
#include "omp.h"
#include "utils.h"
+#include "CCPiDefines.h"
/* C-OMP implementation of FGP-TV [1] denoising/regularization model (2D/3D case)
*
@@ -55,17 +56,17 @@ limitations under the License.
extern "C" {
#endif
//float copyIm(float *A, float *B, int dimX, int dimY, int dimZ);
-float Obj_func2D(float *A, float *D, float *R1, float *R2, float lambda, int dimX, int dimY);
-float Grad_func2D(float *P1, float *P2, float *D, float *R1, float *R2, float lambda, int dimX, int dimY);
-float Proj_func2D(float *P1, float *P2, int methTV, int dimX, int dimY);
-float Rupd_func2D(float *P1, float *P1_old, float *P2, float *P2_old, float *R1, float *R2, float tkp1, float tk, int dimX, int dimY);
-float Obj_func_CALC2D(float *A, float *D, float *funcvalA, float lambda, int dimX, int dimY);
+CCPI_EXPORT float Obj_func2D(float *A, float *D, float *R1, float *R2, float lambda, int dimX, int dimY);
+CCPI_EXPORT float Grad_func2D(float *P1, float *P2, float *D, float *R1, float *R2, float lambda, int dimX, int dimY);
+CCPI_EXPORT float Proj_func2D(float *P1, float *P2, int methTV, int dimX, int dimY);
+CCPI_EXPORT float Rupd_func2D(float *P1, float *P1_old, float *P2, float *P2_old, float *R1, float *R2, float tkp1, float tk, int dimX, int dimY);
+CCPI_EXPORT float Obj_func_CALC2D(float *A, float *D, float *funcvalA, float lambda, int dimX, int dimY);
-float Obj_func3D(float *A, float *D, float *R1, float *R2, float *R3, float lambda, int dimX, int dimY, int dimZ);
-float Grad_func3D(float *P1, float *P2, float *P3, float *D, float *R1, float *R2, float *R3, float lambda, int dimX, int dimY, int dimZ);
-float Proj_func3D(float *P1, float *P2, float *P3, int dimX, int dimY, int dimZ);
-float Rupd_func3D(float *P1, float *P1_old, float *P2, float *P2_old, float *P3, float *P3_old, float *R1, float *R2, float *R3, float tkp1, float tk, int dimX, int dimY, int dimZ);
-float Obj_func_CALC3D(float *A, float *D, float *funcvalA, float lambda, int dimX, int dimY, int dimZ);
+CCPI_EXPORT float Obj_func3D(float *A, float *D, float *R1, float *R2, float *R3, float lambda, int dimX, int dimY, int dimZ);
+CCPI_EXPORT float Grad_func3D(float *P1, float *P2, float *P3, float *D, float *R1, float *R2, float *R3, float lambda, int dimX, int dimY, int dimZ);
+CCPI_EXPORT float Proj_func3D(float *P1, float *P2, float *P3, int dimX, int dimY, int dimZ);
+CCPI_EXPORT float Rupd_func3D(float *P1, float *P1_old, float *P2, float *P2_old, float *P3, float *P3_old, float *R1, float *R2, float *R3, float tkp1, float tk, int dimX, int dimY, int dimZ);
+CCPI_EXPORT float Obj_func_CALC3D(float *A, float *D, float *funcvalA, float lambda, int dimX, int dimY, int dimZ);
#ifdef __cplusplus
}
#endif \ No newline at end of file
diff --git a/Core/regularizers_CPU/LLT_model_core.h b/Core/regularizers_CPU/LLT_model_core.h
index 13fce5a..ee106db 100644
--- a/Core/regularizers_CPU/LLT_model_core.h
+++ b/Core/regularizers_CPU/LLT_model_core.h
@@ -24,6 +24,7 @@ limitations under the License.
#include <stdio.h>
#include "omp.h"
#include "utils.h"
+#include "CCPiDefines.h"
#define EPS 0.01
@@ -31,14 +32,14 @@ limitations under the License.
#ifdef __cplusplus
extern "C" {
#endif
-float der2D(float *U, float *D1, float *D2, int dimX, int dimY, int dimZ);
-float div_upd2D(float *U0, float *U, float *D1, float *D2, int dimX, int dimY, int dimZ, float lambda, float tau);
+CCPI_EXPORT float der2D(float *U, float *D1, float *D2, int dimX, int dimY, int dimZ);
+CCPI_EXPORT float div_upd2D(float *U0, float *U, float *D1, float *D2, int dimX, int dimY, int dimZ, float lambda, float tau);
-float der3D(float *U, float *D1, float *D2, float *D3, int dimX, int dimY, int dimZ);
-float div_upd3D(float *U0, float *U, float *D1, float *D2, float *D3, unsigned short *Map, int switcher, int dimX, int dimY, int dimZ, float lambda, float tau);
+CCPI_EXPORT float der3D(float *U, float *D1, float *D2, float *D3, int dimX, int dimY, int dimZ);
+CCPI_EXPORT float div_upd3D(float *U0, float *U, float *D1, float *D2, float *D3, unsigned CCPI_EXPORT short *Map, int switcher, int dimX, int dimY, int dimZ, float lambda, float tau);
-float calcMap(float *U, unsigned short *Map, int dimX, int dimY, int dimZ);
-float cleanMap(unsigned short *Map, int dimX, int dimY, int dimZ);
+CCPI_EXPORT float calcMap(float *U, unsigned short *Map, int dimX, int dimY, int dimZ);
+CCPI_EXPORT float cleanMap(unsigned short *Map, int dimX, int dimY, int dimZ);
//float copyIm(float *A, float *U, int dimX, int dimY, int dimZ);
#ifdef __cplusplus
diff --git a/Core/regularizers_CPU/PatchBased_Regul_core.h b/Core/regularizers_CPU/PatchBased_Regul_core.h
index d4a8a46..6a13709 100644
--- a/Core/regularizers_CPU/PatchBased_Regul_core.h
+++ b/Core/regularizers_CPU/PatchBased_Regul_core.h
@@ -25,6 +25,7 @@ limitations under the License.
#include <memory.h>
#include <stdio.h>
#include "omp.h"
+#include "CCPiDefines.h"
/* C-OMP implementation of patch-based (PB) regularization (2D and 3D cases).
* This method finds self-similar patches in data and performs one fixed point iteration to mimimize the PB penalty function
@@ -61,9 +62,9 @@ TestTemporalSmoothing.m
#ifdef __cplusplus
extern "C" {
#endif
-float pad_crop(float *A, float *Ap, int OldSizeX, int OldSizeY, int OldSizeZ, int NewSizeX, int NewSizeY, int NewSizeZ, int padXY, int switchpad_crop);
-float PB_FUNC2D(float *A, float *B, int dimX, int dimY, int padXY, int SearchW, int SimilW, float h, float lambda);
-float PB_FUNC3D(float *A, float *B, int dimX, int dimY, int dimZ, int padXY, int SearchW, int SimilW, float h, float lambda);
+CCPI_EXPORT float pad_crop(float *A, float *Ap, int OldSizeX, int OldSizeY, int OldSizeZ, int NewSizeX, int NewSizeY, int NewSizeZ, int padXY, int switchpad_crop);
+CCPI_EXPORT float PB_FUNC2D(float *A, float *B, int dimX, int dimY, int padXY, int SearchW, int SimilW, float h, float lambda);
+CCPI_EXPORT float PB_FUNC3D(float *A, float *B, int dimX, int dimY, int dimZ, int padXY, CCPI_EXPORT int SearchW, int SimilW, float h, float lambda);
#ifdef __cplusplus
}
#endif \ No newline at end of file
diff --git a/Core/regularizers_CPU/SplitBregman_TV_core.h b/Core/regularizers_CPU/SplitBregman_TV_core.h
index 6ed3ff9..b6d914e 100644
--- a/Core/regularizers_CPU/SplitBregman_TV_core.h
+++ b/Core/regularizers_CPU/SplitBregman_TV_core.h
@@ -24,6 +24,7 @@ limitations under the License.
#include "omp.h"
#include "utils.h"
+#include "CCPiDefines.h"
/* C-OMP implementation of Split Bregman - TV denoising-regularization model (2D/3D)
*
@@ -54,15 +55,15 @@ extern "C" {
#endif
//float copyIm(float *A, float *B, int dimX, int dimY, int dimZ);
-float gauss_seidel2D(float *U, float *A, float *Dx, float *Dy, float *Bx, float *By, int dimX, int dimY, float lambda, float mu);
-float updDxDy_shrinkAniso2D(float *U, float *Dx, float *Dy, float *Bx, float *By, int dimX, int dimY, float lambda);
-float updDxDy_shrinkIso2D(float *U, float *Dx, float *Dy, float *Bx, float *By, int dimX, int dimY, float lambda);
-float updBxBy2D(float *U, float *Dx, float *Dy, float *Bx, float *By, int dimX, int dimY);
+CCPI_EXPORT float gauss_seidel2D(float *U, float *A, float *Dx, float *Dy, float *Bx, float *By, int dimX, int dimY, float lambda, float mu);
+CCPI_EXPORT float updDxDy_shrinkAniso2D(float *U, float *Dx, float *Dy, float *Bx, float *By, int dimX, int dimY, float lambda);
+CCPI_EXPORT float updDxDy_shrinkIso2D(float *U, float *Dx, float *Dy, float *Bx, float *By, int dimX, int dimY, float lambda);
+CCPI_EXPORT float updBxBy2D(float *U, float *Dx, float *Dy, float *Bx, float *By, int dimX, int dimY);
-float gauss_seidel3D(float *U, float *A, float *Dx, float *Dy, float *Dz, float *Bx, float *By, float *Bz, int dimX, int dimY, int dimZ, float lambda, float mu);
-float updDxDyDz_shrinkAniso3D(float *U, float *Dx, float *Dy, float *Dz, float *Bx, float *By, float *Bz, int dimX, int dimY, int dimZ, float lambda);
-float updDxDyDz_shrinkIso3D(float *U, float *Dx, float *Dy, float *Dz, float *Bx, float *By, float *Bz, int dimX, int dimY, int dimZ, float lambda);
-float updBxByBz3D(float *U, float *Dx, float *Dy, float *Dz, float *Bx, float *By, float *Bz, int dimX, int dimY, int dimZ);
+CCPI_EXPORT float gauss_seidel3D(float *U, float *A, float *Dx, float *Dy, float *Dz, float *Bx, float *By, float *Bz, int dimX, int dimY, int dimZ, float lambda, float mu);
+CCPI_EXPORT float updDxDyDz_shrinkAniso3D(float *U, float *Dx, float *Dy, float *Dz, float *Bx, float *By, float *Bz, int dimX, int dimY, int dimZ, float lambda);
+CCPI_EXPORT float updDxDyDz_shrinkIso3D(float *U, float *Dx, float *Dy, float *Dz, float *Bx, float *By, float *Bz, int dimX, int dimY, int dimZ, float lambda);
+CCPI_EXPORT float updBxByBz3D(float *U, float *Dx, float *Dy, float *Dz, float *Bx, float *By, float *Bz, int dimX, int dimY, int dimZ);
#ifdef __cplusplus
}
diff --git a/Core/regularizers_CPU/TGV_PD_core.h b/Core/regularizers_CPU/TGV_PD_core.h
index d5378df..88fbcc1 100644
--- a/Core/regularizers_CPU/TGV_PD_core.h
+++ b/Core/regularizers_CPU/TGV_PD_core.h
@@ -24,6 +24,7 @@ limitations under the License.
#include <stdio.h>
#include "omp.h"
#include "utils.h"
+#include "CCPiDefines.h"
/* C-OMP implementation of Primal-Dual denoising method for
* Total Generilized Variation (TGV)-L2 model (2D case only)
@@ -54,13 +55,13 @@ limitations under the License.
extern "C" {
#endif
/* 2D functions */
-float DualP_2D(float *U, float *V1, float *V2, float *P1, float *P2, int dimX, int dimY, int dimZ, float sigma);
-float ProjP_2D(float *P1, float *P2, int dimX, int dimY, int dimZ, float alpha1);
-float DualQ_2D(float *V1, float *V2, float *Q1, float *Q2, float *Q3, int dimX, int dimY, int dimZ, float sigma);
-float ProjQ_2D(float *Q1, float *Q2, float *Q3, int dimX, int dimY, int dimZ, float alpha0);
-float DivProjP_2D(float *U, float *A, float *P1, float *P2, int dimX, int dimY, int dimZ, float lambda, float tau);
-float UpdV_2D(float *V1, float *V2, float *P1, float *P2, float *Q1, float *Q2, float *Q3, int dimX, int dimY, int dimZ, float tau);
-float newU(float *U, float *U_old, int dimX, int dimY, int dimZ);
+CCPI_EXPORT float DualP_2D(float *U, float *V1, float *V2, float *P1, float *P2, int dimX, int dimY, int dimZ, float sigma);
+CCPI_EXPORT float ProjP_2D(float *P1, float *P2, int dimX, int dimY, int dimZ, float alpha1);
+CCPI_EXPORT float DualQ_2D(float *V1, float *V2, float *Q1, float *Q2, float *Q3, int dimX, int dimY, int dimZ, float sigma);
+CCPI_EXPORT float ProjQ_2D(float *Q1, float *Q2, float *Q3, int dimX, int dimY, int dimZ, float alpha0);
+CCPI_EXPORT float DivProjP_2D(float *U, float *A, float *P1, float *P2, int dimX, int dimY, int dimZ, float lambda, float tau);
+CCPI_EXPORT float UpdV_2D(float *V1, float *V2, float *P1, float *P2, float *Q1, float *Q2, float *Q3, int dimX, int dimY, int dimZ, float tau);
+CCPI_EXPORT float newU(float *U, float *U_old, int dimX, int dimY, int dimZ);
//float copyIm(float *A, float *U, int dimX, int dimY, int dimZ);
#ifdef __cplusplus
}
diff --git a/Core/regularizers_CPU/utils.h b/Core/regularizers_CPU/utils.h
index 53463a3..91b8209 100644
--- a/Core/regularizers_CPU/utils.h
+++ b/Core/regularizers_CPU/utils.h
@@ -21,12 +21,13 @@ limitations under the License.
//#include <math.h>
#include <stdlib.h>
#include <memory.h>
+#include "CCPiDefines.h"
//#include <stdio.h>
#include "omp.h"
#ifdef __cplusplus
extern "C" {
#endif
-float copyIm(float *A, float *U, int dimX, int dimY, int dimZ);
+CCPI_EXPORT float copyIm(float *A, float *U, int dimX, int dimY, int dimZ);
#ifdef __cplusplus
}
#endif
diff --git a/Core/regularizers_GPU/Diffus_HO/Diff4th_GPU_kernel.h b/Core/regularizers_GPU/Diffus_HO/Diff4th_GPU_kernel.h
index cfbb45a..fefef8d 100644
--- a/Core/regularizers_GPU/Diffus_HO/Diff4th_GPU_kernel.h
+++ b/Core/regularizers_GPU/Diffus_HO/Diff4th_GPU_kernel.h
@@ -1,6 +1,7 @@
#ifndef __DIFF_HO_H_
#define __DIFF_HO_H_
+#include "CCPiDefines.h"
-extern "C" void Diff4th_GPU_kernel(float* A, float* B, int N, int M, int Z, float sigma, int iter, float tau, float lambda);
+extern "C" CCPI_EXPORT void Diff4th_GPU_kernel(float* A, float* B, int N, int M, int Z, float sigma, int iter, float tau, float lambda);
#endif
diff --git a/Core/regularizers_GPU/NL_Regul/NLM_GPU_kernel.h b/Core/regularizers_GPU/NL_Regul/NLM_GPU_kernel.h
index bc9d4a3..f370d0d 100644
--- a/Core/regularizers_GPU/NL_Regul/NLM_GPU_kernel.h
+++ b/Core/regularizers_GPU/NL_Regul/NLM_GPU_kernel.h
@@ -1,6 +1,7 @@
#ifndef __NLMREG_KERNELS_H_
#define __NLMREG_KERNELS_H_
+#include "CCPiDefines.h"
-extern "C" void NLM_GPU_kernel(float *A, float* B, float *Eucl_Vec, int N, int M, int Z, int dimension, int SearchW, int SimilW, int SearchW_real, float denh2, float lambda);
+extern "C" CCPI_EXPORT void NLM_GPU_kernel(float *A, float* B, float *Eucl_Vec, int N, int M, int Z, int dimension, int SearchW, int SimilW, int SearchW_real, float denh2, float lambda);
#endif