summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdoardo Pasca <edo.paskino@gmail.com>2017-08-02 16:51:37 +0100
committerEdoardo Pasca <edo.paskino@gmail.com>2017-10-11 15:28:35 +0100
commit068380a2a2c84b46e486f59c397329f53a2eae1f (patch)
treef9e39ea26cd92c1490217397a82085b99e5e98c1
parent33da5e128e51e5adc1f6085b4772b55b2cd76e2e (diff)
downloadregularization-068380a2a2c84b46e486f59c397329f53a2eae1f.tar.gz
regularization-068380a2a2c84b46e486f59c397329f53a2eae1f.tar.bz2
regularization-068380a2a2c84b46e486f59c397329f53a2eae1f.tar.xz
regularization-068380a2a2c84b46e486f59c397329f53a2eae1f.zip
Added utils.c utils.h
a few regularizers defined the same copyIm function. I moved it into this new common utils.
-rw-r--r--main_func/regularizers_CPU/utils.c29
-rw-r--r--main_func/regularizers_CPU/utils.h27
2 files changed, 56 insertions, 0 deletions
diff --git a/main_func/regularizers_CPU/utils.c b/main_func/regularizers_CPU/utils.c
new file mode 100644
index 0000000..0e83d2c
--- /dev/null
+++ b/main_func/regularizers_CPU/utils.c
@@ -0,0 +1,29 @@
+/*
+This work is part of the Core Imaging Library developed by
+Visual Analytics and Imaging System Group of the Science Technology
+Facilities Council, STFC
+
+Copyright 2017 Daniil Kazanteev
+Copyright 2017 Srikanth Nagella, Edoardo Pasca
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+#include "utils.h"
+
+/* Copy Image */
+float copyIm(float *A, float *U, int dimX, int dimY, int dimZ)
+{
+ int j;
+#pragma omp parallel for shared(A, U) private(j)
+ for (j = 0; j<dimX*dimY*dimZ; j++) U[j] = A[j];
+ return *U;
+} \ No newline at end of file
diff --git a/main_func/regularizers_CPU/utils.h b/main_func/regularizers_CPU/utils.h
new file mode 100644
index 0000000..c720006
--- /dev/null
+++ b/main_func/regularizers_CPU/utils.h
@@ -0,0 +1,27 @@
+/*
+This work is part of the Core Imaging Library developed by
+Visual Analytics and Imaging System Group of the Science Technology
+Facilities Council, STFC
+
+Copyright 2017 Daniil Kazanteev
+Copyright 2017 Srikanth Nagella, Edoardo Pasca
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+#include <matrix.h>
+#include <math.h>
+#include <stdlib.h>
+#include <memory.h>
+#include <stdio.h>
+#include "omp.h"
+
+float copyIm(float *A, float *U, int dimX, int dimY, int dimZ);