From 08ff4346d448ba693d8dcded708215cdae1f7971 Mon Sep 17 00:00:00 2001 From: Daniil Kazantsev Date: Sat, 11 Mar 2023 16:07:00 +0000 Subject: [PATCH 01/10] restructuring using pyproject --- {scripts => .scripts}/conda_upload.sh | 0 {scripts => .scripts}/decrypt_secret.sh | 0 {scripts => .scripts}/my_secret.json.gpg | Bin CMakeLists.txt | 32 -- INSTALLATION | 20 - Readme.md | 16 +- conda-recipe/build.sh | 8 - conda-recipe/conda_build_config.yaml | 12 +- .../tomobar_env_20_06_22.txt | 0 conda-recipe/meta.yaml | 45 ++- environment.yml | 7 - pyproject.toml | 106 ++++++ run.sh | 16 - src/CMakeLists.txt | 15 - src/Core/CMakeLists.txt | 83 ----- src/Core/functions_CPU/RingWeights_core.c | 347 ------------------ src/Core/functions_CPU/utils.c | 38 -- src/Core/include/RingWeights_core.h | 52 --- src/Core/include/dll_export.h | 38 -- src/Core/include/utils.h | 27 -- src/Python/CMakeLists.txt | 103 ------ src/Python/setup-tomobar.py.in | 67 ---- src/Python/src/cpu_wrappers.pyx | 55 --- src/Python/temp/__init__.py | 0 src/Python/temp/read_hdf5.py | 41 --- src/Python/temp/smoothSignal.py | 124 ------- src/Python/tomobar/__init__.py | 0 src/Python/tomobar/supp/__init__.py | 0 {test => tests}/test_tomobarCPU_DIR.py | 0 {src/Python => tomobar}/__init__.py | 0 {src/Python/tomobar => tomobar}/__init__.pyc | Bin tomobar/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 146 bytes tomobar/__pycache__/methodsIR.cpython-310.pyc | Bin 0 -> 20967 bytes .../matlab}/main_func/ADMM_REC.m | 0 .../matlab}/main_func/FISTA_REC.m | 0 .../matlab}/main_func/studentst.m | 0 .../installed/MEXed_files_location.txt | 0 .../matlab}/supplementary/RMSE.m | 0 .../TomoPhantom/uncompress files here | 0 .../supplementary/spot/uncompress files here | 0 {src/Python/tomobar => tomobar}/methodsDIR.py | 0 {src/Python/tomobar => tomobar}/methodsIR.py | 5 - {src/Python/src => tomobar/supp}/__init__.py | 0 .../tomobar => tomobar}/supp/__init__.pyc | Bin .../supp/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 151 bytes .../supp/__pycache__/astraOP.cpython-310.pyc | Bin 0 -> 14357 bytes .../tomobar => tomobar}/supp/astraOP.py | 0 .../tomobar => tomobar}/supp/suppTools.py | 0 48 files changed, 147 insertions(+), 1110 deletions(-) rename {scripts => .scripts}/conda_upload.sh (100%) rename {scripts => .scripts}/decrypt_secret.sh (100%) rename {scripts => .scripts}/my_secret.json.gpg (100%) delete mode 100644 CMakeLists.txt delete mode 100644 INSTALLATION delete mode 100755 conda-recipe/build.sh mode change 100644 => 100755 conda-recipe/conda_build_config.yaml rename conda-recipe/{ => explicit_packages}/tomobar_env_20_06_22.txt (100%) delete mode 100644 environment.yml create mode 100644 pyproject.toml delete mode 100755 run.sh delete mode 100644 src/CMakeLists.txt delete mode 100644 src/Core/CMakeLists.txt delete mode 100644 src/Core/functions_CPU/RingWeights_core.c delete mode 100644 src/Core/functions_CPU/utils.c delete mode 100644 src/Core/include/RingWeights_core.h delete mode 100755 src/Core/include/dll_export.h delete mode 100644 src/Core/include/utils.h delete mode 100644 src/Python/CMakeLists.txt delete mode 100644 src/Python/setup-tomobar.py.in delete mode 100644 src/Python/src/cpu_wrappers.pyx delete mode 100644 src/Python/temp/__init__.py delete mode 100644 src/Python/temp/read_hdf5.py delete mode 100644 src/Python/temp/smoothSignal.py delete mode 100644 src/Python/tomobar/__init__.py delete mode 100644 src/Python/tomobar/supp/__init__.py rename {test => tests}/test_tomobarCPU_DIR.py (100%) rename {src/Python => tomobar}/__init__.py (100%) rename {src/Python/tomobar => tomobar}/__init__.pyc (100%) create mode 100644 tomobar/__pycache__/__init__.cpython-310.pyc create mode 100644 tomobar/__pycache__/methodsIR.cpython-310.pyc rename {src/Matlab => tomobar/matlab}/main_func/ADMM_REC.m (100%) rename {src/Matlab => tomobar/matlab}/main_func/FISTA_REC.m (100%) rename {src/Matlab => tomobar/matlab}/main_func/studentst.m (100%) rename {src/Matlab => tomobar/matlab}/supplementary/CCPi-Regularisation-Toolkit/Wrappers/Matlab/mex_compile/installed/MEXed_files_location.txt (100%) rename {src/Matlab => tomobar/matlab}/supplementary/RMSE.m (100%) rename {src/Matlab => tomobar/matlab}/supplementary/TomoPhantom/uncompress files here (100%) rename {src/Matlab => tomobar/matlab}/supplementary/spot/uncompress files here (100%) rename {src/Python/tomobar => tomobar}/methodsDIR.py (100%) rename {src/Python/tomobar => tomobar}/methodsIR.py (99%) rename {src/Python/src => tomobar/supp}/__init__.py (100%) rename {src/Python/tomobar => tomobar}/supp/__init__.pyc (100%) create mode 100644 tomobar/supp/__pycache__/__init__.cpython-310.pyc create mode 100644 tomobar/supp/__pycache__/astraOP.cpython-310.pyc rename {src/Python/tomobar => tomobar}/supp/astraOP.py (100%) rename {src/Python/tomobar => tomobar}/supp/suppTools.py (100%) diff --git a/scripts/conda_upload.sh b/.scripts/conda_upload.sh similarity index 100% rename from scripts/conda_upload.sh rename to .scripts/conda_upload.sh diff --git a/scripts/decrypt_secret.sh b/.scripts/decrypt_secret.sh similarity index 100% rename from scripts/decrypt_secret.sh rename to .scripts/decrypt_secret.sh diff --git a/scripts/my_secret.json.gpg b/.scripts/my_secret.json.gpg similarity index 100% rename from scripts/my_secret.json.gpg rename to .scripts/my_secret.json.gpg diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index f045c7989..000000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# 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. - -cmake_minimum_required (VERSION 3.0) - -project(tomobar) - -set (tomobar_VERSION $ENV{tomobar_VERSION} CACHE INTERNAL "tomobar modules" FORCE) -message(STATUS "tomobar_VERSION set to " ${tomobar_VERSION}) - -# set the Python variables for the Conda environment -option (BUILD_PYTHON_WRAPPER "Build Python Wrappers" ON) -option (CONDA_BUILD "Conda Build" OFF) - -set(PYTHON_DEST_DIR "" CACHE PATH "Directory of the Python wrappers") -if (PYTHON_DEST_DIR) - set(PYTHON_DEST "${PYTHON_DEST_DIR}") -else() - set(PYTHON_DEST "${CMAKE_INSTALL_PREFIX}/python") -endif() -message(STATUS "Python wrappers will be installed in " ${PYTHON_DEST}) - -add_subdirectory(src) diff --git a/INSTALLATION b/INSTALLATION deleted file mode 100644 index f7fedf5d2..000000000 --- a/INSTALLATION +++ /dev/null @@ -1,20 +0,0 @@ -** INSTALLATION of dependencies for Matlab ** -Here we provide detailed installation information for the following dependencies: - - ## ASTRA-toolbox ----------- can be downloaded at https://www.astra-toolbox.com/downloads/index.html and installed according to the documentation. In Matlab provide path to the package. - -## Software dependencies for TomoRec (Matlab advices): - -* [CCPi-Regularisation Toolkit](https://github.com/vais-ral/CCPi-Regularisation-Toolkit) ----------- uncompress the content into "Supplementary/CCPi-Regularisation-Toolkit/" folder. -1. Start matlab and proceed to the folder "supplementary/CCPi-Regularisation-Toolkit/Wrappers/Matlab/mex_compile/" -2. run compileCPU_mex.m to compile CPU functions -3. open compileGPU_mex.m and edit according to your system specifications -4. run compileGPU_mex.m to compile GPU functions - -* [TomoBAR](https://github.com/dkazanc/TomoPhantom) ----------- uncompress the content into "Supplementary/TomoPhantom/" folder. -1. Start matlab and proceed to the folder "supplementary/TomoPhantom/matlab/install" -2. Run compile_mex_linux.m or compile_mex_windows.m to install the package - diff --git a/Readme.md b/Readme.md index 0667837f4..00e6ca844 100644 --- a/Readme.md +++ b/Readme.md @@ -20,7 +20,7 @@ * A wrapper around [ASTRA-toolbox](https://www.astra-toolbox.com/) to simplify access to various reconstruction methods available in ASTRA * Regularised iterative ordered-subsets [FISTA](https://epubs.siam.org/doi/10.1137/080716542) reconstruction algorithm with linear and non-linear data fidelities * Regularised iterative [ADMM](https://ieeexplore.ieee.org/document/7744574/) reconstruction algorithm - * Access to multi-GPU capability through mpi4py + * Access to multi-GPU capability through mpi4py library * Demos to reconstruct synthetic and also real data (provided) [4-6]
@@ -36,7 +36,7 @@ * The FISTA algorithm offers various modifications: convergence acceleration with ordered-subsets method; data fidelities: PWLS, Kullback-Leibler, Huber, Group-Huber[2], Students't [3,4], and SWLS [5] to deal with noise and imaging artifacts (rings, streaks). ### General software prerequisites - * Python or [MATLAB](http://www.mathworks.com/products/matlab/) + * Python or [MATLAB](http://www.mathworks.com/products/matlab/) (not actively maintained currently) ### Software dependencies * [ASTRA-toolbox](https://www.astra-toolbox.com/) for projection operations @@ -66,8 +66,12 @@ conda install -c file://${CONDA_PREFIX}/conda-bld/ tomobar --force-reinstall conda install tomobar --use-local --force-reinstall # if Python2 ``` -### Python standalone -For building on Linux, modify and run the following [script](https://github.com/dkazanc/ToMoBAR/blob/master/run.sh) +### Python development environment +* Clone the repository from GitHub page +* Install dependencies from the environment file +* Alternatively you can install from the existing explicit file +* Activate the environment with :code:`conda activate tomobar` +* From the root directory install the enviroment in development mode with :code:`pip install -e .[dev]` ### MultiGPU capability ToMoBAR can be used by running in parallel across multiple GPU devices on a PC or a compute node of a cluster. In order to initiate a parallel run on multiple GPUs you will need an MPI library, such as, [mpi4py](https://mpi4py.readthedocs.io/en/stable/). See this [demo](https://github.com/dkazanc/ToMoBAR/blob/master/Demos/Python/MultiGPU_demo.py). @@ -76,12 +80,12 @@ ToMoBAR can be used by running in parallel across multiple GPU devices on a PC o Use available m-functions, see [Demos](https://github.com/dkazanc/ToMoBAR/tree/master/Demos/Matlab). ## How to use ToMoBAR in Python: -Detailed information about the methods and its parameters can be obtained with: +Detailed information about the methods and parameters can be obtained with: ``` from tomobar.methodsIR import RecToolsIR help(RecToolsIR) from tomobar.methodsDIR import RecToolsDIR -help(RecToolsIR) +help(RecToolsDIR) ``` A typical setup for iterative reconstruction would include building three dictionaries: `_data_`, `_algorithm_` and `_regularisation_` diff --git a/conda-recipe/build.sh b/conda-recipe/build.sh deleted file mode 100755 index 0f2041b20..000000000 --- a/conda-recipe/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -set -xe -cp -rv "$RECIPE_DIR/../test" "$SRC_DIR/" - -cd $SRC_DIR - -cmake -G "Unix Makefiles" $RECIPE_DIR/../ -DBUILD_PYTHON_WRAPPER=ON -DCONDA_BUILD=ON -DCMAKE_BUILD_TYPE="Release" -DLIBRARY_LIB=$CONDA_PREFIX/lib -DLIBRARY_INC=$CONDA_PREFIX -DCMAKE_INSTALL_PREFIX=$PREFIX - -make install diff --git a/conda-recipe/conda_build_config.yaml b/conda-recipe/conda_build_config.yaml old mode 100644 new mode 100755 index 16ad0bb1f..202298a3a --- a/conda-recipe/conda_build_config.yaml +++ b/conda-recipe/conda_build_config.yaml @@ -1,10 +1,4 @@ python: - - 3.5 - - 3.6 - - 3.7 -numpy: - - 1.12 - - 1.14 - - 1.15 - - 1.16 - - 1.21 + - 3.10 +numpy: + - 1.22 \ No newline at end of file diff --git a/conda-recipe/tomobar_env_20_06_22.txt b/conda-recipe/explicit_packages/tomobar_env_20_06_22.txt similarity index 100% rename from conda-recipe/tomobar_env_20_06_22.txt rename to conda-recipe/explicit_packages/tomobar_env_20_06_22.txt diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index cee96baae..d68ff2012 100755 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -1,34 +1,45 @@ +{% set name = "tomobar" %} + package: - name: tomobar + name: {{ name|lower }} version: {{ environ['VERSION'] }} +source: + path: .. + build: preserve_egg_dir: False number: 0 - script_env: - - VERSION - -test: - source_files: - - ./test/ - commands: - - python -c "import os; print (os.getcwd())" - - python -m unittest discover -s test + script: {{ PYTHON }} -m pip install --no-deps --ignore-installed . requirements: - build: + host: - python - - numpy + - pip - setuptools - - cython - - cmake run: - - scipy - python - numpy - - libgcc-ng # [unix] + - setuptools + - scipy + - pillow + - scikit-image + - pytest +test: + requires: + - pip + - pytest + source_files: + - tests/* + commands: + - pip check + - pytest about: home: https://github.com/dkazanc/ToMoBAR - license: GPLv3 summary: 'TOmographic MOdel-BAsed Reconstruction (ToMoBAR) software' + description: | + A collection of direct and iterative methods for parallel beam tomography +extra: + recipe-maintainers: + - dkazanc \ No newline at end of file diff --git a/environment.yml b/environment.yml deleted file mode 100644 index 14e864c27..000000000 --- a/environment.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: tomobar -channels: -- conda-forge -- defaults -dependencies: -- python=3.7 -- numpy diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..9130792c3 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,106 @@ +[build-system] +requires = ["setuptools>=42", "wheel", "setuptools-git-versioning"] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +packages = ["tomobar"] + +[tool.setuptools-git-versioning] +enabled = true + +[project] +name = "tomobar" +description = "TOmographic MOdel-BAsed Reconstruction (ToMoBAR) software" +readme = "Readme.md" +license = {text = "GPLv3"} +authors = [ + {name = "Daniil Kazantsev", email = "daniil.kazantsev@diamond.ac.uk"}, +] +classifiers = [ + "Development Status :: 4 - Beta", + "License :: OSI Approved :: GPLv3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.9", + "Environment :: GPU :: NVIDIA CUDA" +] +requires-python = ">=3.9" +dynamic = ["version"] +dependencies = [ + "numpy", + "scipy", + "pillow", + "scikit-image" +] + +[project.optional-dependencies] +dev = [ + "pytest", + "pytest-cov", + "pytest-xdist", + "flake8", + "pyproject-flake8", + "pydocstyle", + "toml", + "imageio", + "h5py" +] + + +[project.urls] +"Repository" = "https://github.com/dkazanc/ToMoBAR" + +[tool.pytest.ini_options] +minversion = "6.0" +addopts = [ + "-vv", + "-ra", + "-q", + "--tb=native", + "--cov-report=term", + "--cov-report=xml:cov.xml", +] +testpaths = [ + "tests", +] +filterwarnings = [ + "ignore::DeprecationWarning", + "ignore::pytest.PytestUnknownMarkWarning", + "ignore::scipy.stats.ConstantInputWarning", +] + +[tool.coverage.run] +data_file = "/tmp/tomobar.coverage" + +[tool.coverage.paths] +# Tests are run from installed location, map back to the src directory +source = [ + "tomobar", + "**/site-packages/" +] + +[tool.mypy] +# Ignore missing stubs for modules we use +ignore_missing_imports = true + +[tool.isort] +profile = "black" +float_to_top = true + +[tool.pydocstyle] +convention = "google" +add-ignore = [ + "D100", # Ignore missing docstrings in public modules + "D104", # Ignore missing docstrings in public packages + "D418", # Ignore missing docstrings in dunder methods; See: https://github.com/PyCQA/pydocstyle/issues/525 +] + +[tool.flake8] +# Make flake8 respect black's line length (default 88), +max-line-length = 88 +extend-ignore = [ + "E203", + "F811" +] +per-file-ignores = [ + "*pyi:E302" +] diff --git a/run.sh b/run.sh deleted file mode 100755 index 1b7a024a0..000000000 --- a/run.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -# Requires Cython, install it first: conda install cython -echo "Building ToMoBAR software using CMake" -rm -r build -mkdir build -cd build -#make clean -export VERSION=`date +%Y.%m` -# install Python modules with CMAKE -cmake ../ -DBUILD_PYTHON_WRAPPER=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./install -make install -############### Python(linux)############### -cp install/lib/libtomobar.so install/python/tomobar/supp/ -cd install/python -export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:../lib -spyder --new-instance diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index b032f6e28..000000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# 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. -add_subdirectory(Core) -if (BUILD_PYTHON_WRAPPER) - add_subdirectory(Python) -endif() diff --git a/src/Core/CMakeLists.txt b/src/Core/CMakeLists.txt deleted file mode 100644 index c863dbbdc..000000000 --- a/src/Core/CMakeLists.txt +++ /dev/null @@ -1,83 +0,0 @@ -#cmake_minimum_required (VERSION 3.0) - -project(tomobar_core) - -# The version number. -set (tomobar_VERSION $ENV{tomobar_VERSION} CACHE INTERNAL "tomobar module" FORCE) - -# conda orchestrated build -message("tomobar_VERSION ${tomobar_VERSION}") -#include (GenerateExportHeader) - - -find_package(OpenMP) -if (OPENMP_FOUND) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") - set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_SHARED_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") - set (CMAKE_STATIC_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_STATIC_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") - -endif() - -message("CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}") -message("CMAKE_C_FLAGS ${CMAKE_C_FLAGS}") -message("CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}") -message("CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS}") -message("CMAKE_STATIC_LINKER_FLAGS ${CMAKE_STATIC_LINKER_FLAGS}") - -set(CMAKE_BUILD_TYPE "Release") - -if(WIN32) - set (FLAGS "/DWIN32 /EHsc /openmp") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}") - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:MSVCRT.lib") - - set (EXTRA_LIBRARIES) - - message("library lib: ${LIBRARY_LIB}") - -elseif(UNIX) - # this is GCC specific - set (FLAGS "-O2 -funsigned-char -Wall -Wl,--no-undefined") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS}") - - set (EXTRA_LIBRARIES - "gomp" - "m" - ) - -endif() -message("CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}") - -message("Adding ToMoBAR as a shared library") - -add_library(tomobar SHARED - ${CMAKE_CURRENT_SOURCE_DIR}/functions_CPU/RingWeights_core.c - ${CMAKE_CURRENT_SOURCE_DIR}/functions_CPU/utils.c - ) -target_link_libraries(tomobar ${EXTRA_LIBRARIES} ) -target_include_directories(tomobar PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) - -target_include_directories(tomobar PUBLIC - ${LIBRARY_INC}/include - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/functions_CPU/ ) - -## Install -if (UNIX) -message ("I'd install into ${CMAKE_INSTALL_PREFIX}/lib") -install(TARGETS tomobar - LIBRARY DESTINATION lib - CONFIGURATIONS ${CMAKE_BUILD_TYPE} - ) -elseif(WIN32) -message ("I'd install into ${CMAKE_INSTALL_PREFIX} lib bin") - install(TARGETS tomobar - RUNTIME DESTINATION bin - ARCHIVE DESTINATION lib - CONFIGURATIONS ${CMAKE_BUILD_TYPE} - ) -endif() diff --git a/src/Core/functions_CPU/RingWeights_core.c b/src/Core/functions_CPU/RingWeights_core.c deleted file mode 100644 index eee175221..000000000 --- a/src/Core/functions_CPU/RingWeights_core.c +++ /dev/null @@ -1,347 +0,0 @@ -/* - * Copyright 2019 Daniil Kazantsev / Diamond Light Source Ltd. - * - * 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 "RingWeights_core.h" -#include "utils.h" - -/* -* C function to establish a better model for supressing ring artifacts. -* It should work for full and partial artifacts as well with changing intensity -* -* Input parameters: -* 1. horiz_window_halfsize - int parameter which defines the approximate thickness of -* rings present in the reconstruction / stripes in the sinogram -* 2. vert_window_halfsize - ONLY for 3D when a stack of sinograms is being considered -* -* Output: -* 1. Weights - estimated weights which must be added to residual in order to -* calculate non-linear response of Huber function or something else in application to -* data residual -*/ - - -void swap(float *xp, float *yp) -{ - float temp = *xp; - *xp = *yp; - *yp = temp; -} - - -float RingWeights_main(float *residual, float *weights, int window_halfsize_detectors, int window_halfsize_angles, int window_halfsize_projections, long anglesDim, long detectorsDim, long slices) -{ - long i, j, k; - int detectors_full_window, angles_full_window, projections_full_window; - detectors_full_window = (int)(2*window_halfsize_detectors+1); - angles_full_window = (int)(2*window_halfsize_angles+1); - projections_full_window = (int)(2*window_halfsize_projections+1); - float *weights_temp; - weights_temp = (float*) calloc (anglesDim*detectorsDim*slices, sizeof(float)); - - if (slices == 1) { - /****************2D INPUT ***************/ - /* 1 case is when window_halfsize_angles = 0, meaning that we work solely - with detectors dimensionality of the sinogram - 2 case - get median across angles dimension as well */ - if (window_halfsize_angles == 0) { - #pragma omp parallel for shared(residual, weights_temp) private(j, i) - for(i=0; i= 0) && (j1 < detectorsDim)) { - Values_Vec[counter] = residual[i*detectorsDim+j1]; } - else Values_Vec[counter] = residual[index]; - counter++; - } - /* perform sorting of the vector array */ - for (x = 0; x < counter-1; x++) { - for (y = 0; y < counter-x-1; y++) { - if (Values_Vec[y] > Values_Vec[y+1]) { - swap(&Values_Vec[y], &Values_Vec[y+1]); - } - } - } - weights_temp[index] = Values_Vec[midval]; - - free(Values_Vec); - return *weights_temp; -} - -float RingWeights_angles2D(float *weights_temp, float *weights, int window_halfsize_angles, int angles_full_window, long anglesDim, long detectorsDim, long j, long i) -{ - long k, i1, index; - int counter, x, y, midval; - float *Values_Vec; - - index = i*detectorsDim+j; - Values_Vec = (float*) calloc (angles_full_window, sizeof(float)); - midval = (int)(0.5f*angles_full_window) - 1; - - counter = 0; - for (k=-window_halfsize_angles; k <= window_halfsize_angles; k++) { - i1 = i + k; - if ((i1 >= 0) && (i1 < anglesDim)) { - Values_Vec[counter] = weights_temp[i1*detectorsDim+j]; } - else Values_Vec[counter] = weights_temp[index]; - counter++; - } - /* perform sorting of the vector array */ - for (x = 0; x < counter-1; x++) { - for (y = 0; y < counter-x-1; y++) { - if (Values_Vec[y] > Values_Vec[y+1]) { - swap(&Values_Vec[y], &Values_Vec[y+1]); - } - } - } - weights[index] = Values_Vec[midval]; - - free(Values_Vec); - return *weights; -} -/********************************************************************/ -/***************************3D Functions*****************************/ -/********************************************************************/ -float RingWeights_proj3D(float *residual, float *weights_temp, int window_halfsize_projections, int projections_full_window, long anglesDim, long detectorsDim, long slices, long j, long i, long k) -{ - float *Values_Vec; - long z, k1, index; - int counter, x, y, midval; - - index = detectorsDim*anglesDim*k + i*detectorsDim+j; - - Values_Vec = (float*) calloc (projections_full_window, sizeof(float)); - midval = (int)(0.5f*projections_full_window) - 1; - - /* intiate the estimation of the backround using strictly slice values */ - counter = 0; - for (z=-window_halfsize_projections; z <= window_halfsize_projections; z++) { - k1 = z + k; - if ((k1 >= 0) && (k1 < slices)) { - Values_Vec[counter] = residual[detectorsDim*anglesDim*k1 + i*detectorsDim+j]; } - else Values_Vec[counter] = residual[index]; - counter++; - } - - /* perform sorting of the vector array */ - for (x = 0; x < counter-1; x++) { - for (y = 0; y < counter-x-1; y++) { - if (Values_Vec[y] > Values_Vec[y+1]) { - swap(&Values_Vec[y], &Values_Vec[y+1]); - } - } - } - weights_temp[index] = Values_Vec[midval]; - free(Values_Vec); - return *weights_temp; -} - -float RingWeights_det3D(float *residual, float *weights_temp, int window_halfsize_detectors, int detectors_full_window, long anglesDim, long detectorsDim, long slices, long j, long i, long k) -{ - float *Values_Vec; - long m, j1, index; - int counter, x, y, midval; - - index = detectorsDim*anglesDim*k + i*detectorsDim+j; - - Values_Vec = (float*) calloc (detectors_full_window, sizeof(float)); - midval = (int)(0.5f*detectors_full_window) - 1; - - /* intiate the estimation of the backround using strictly horizontal values (detectors dimension) */ - counter = 0; - for (m=-window_halfsize_detectors; m <= window_halfsize_detectors; m++) { - j1 = j + m; - if ((j1 >= 0) && (j1 < detectorsDim)) { - Values_Vec[counter] = residual[detectorsDim*anglesDim*k + i*detectorsDim+j1]; } - else Values_Vec[counter] = residual[index]; - counter++; - } - /* perform sorting of the vector array */ - for (x = 0; x < counter-1; x++) { - for (y = 0; y < counter-x-1; y++) { - if (Values_Vec[y] > Values_Vec[y+1]) { - swap(&Values_Vec[y], &Values_Vec[y+1]); - } - } - } - weights_temp[index] = Values_Vec[midval]; - - free(Values_Vec); - return *weights_temp; -} - -float RingWeights_angles3D(float *weights_temp, float *weights, int window_halfsize_angles, int angles_full_window, long anglesDim, long detectorsDim, long slices, long j, long i, long k) -{ - long m, i1, index; - int counter, x, y, midval; - float *Values_Vec; - - index = detectorsDim*anglesDim*k + i*detectorsDim+j; - Values_Vec = (float*) calloc (angles_full_window, sizeof(float)); - midval = (int)(0.5f*angles_full_window) - 1; - - counter = 0; - for (m=-window_halfsize_angles; m <= window_halfsize_angles; m++) { - i1 = i + m; - if ((i1 >= 0) && (i1 < anglesDim)) { - Values_Vec[counter] = weights_temp[detectorsDim*anglesDim*k + i1*detectorsDim+j];} - else Values_Vec[counter] = weights_temp[index]; - counter++; - } - /* perform sorting of the vector array */ - for (x = 0; x < counter-1; x++) { - for (y = 0; y < counter-x-1; y++) { - if (Values_Vec[y] > Values_Vec[y+1]) { - swap(&Values_Vec[y], &Values_Vec[y+1]); - } - } - } - weights[index] = Values_Vec[midval]; - - free(Values_Vec); - return *weights; -} diff --git a/src/Core/functions_CPU/utils.c b/src/Core/functions_CPU/utils.c deleted file mode 100644 index 8bbac92cc..000000000 --- a/src/Core/functions_CPU/utils.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -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 - -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" -#include - -/* Copy Image (float) */ -float copyIm(float *A, float *U, long dimX, long dimY, long dimZ) -{ - long j; -#pragma omp parallel for shared(A, U) private(j) - for (j = 0; j -#include -#include -#include -#include "omp.h" -#include "utils.h" -#include "dll_export.h" - -/* -* C function to establish a better model for supressing ring artifacts. -* It should work for full and partial artifacts as well with changing intensity -* -* Input parameters: -* 1. horiz_window_halfsize - int parameter which defines the approximate thickness of -* rings present in the reconstruction / stripes in the sinogram -* 2. vert_window_halfsize - ONLY for 3D when a stack of sinograms is being considered -* -* Output: -* 1. Weights - estimated weights which must be added to residual in order to -* calculate non-linear response of Huber function or something else in application to -* data residual -*/ - - -#ifdef __cplusplus -extern "C" { -#endif -DLL_EXPORT float RingWeights_main(float *residual, float *weights, int window_halfsize_detectors, int window_halfsize_angles, int window_halfsize_projections, long anglesDim, long detectorsDim, long slices); -/************2D functions ***********/ -DLL_EXPORT float RingWeights_det2D(float *residual, float *weights_temp, int window_halfsize_detectors, int detectors_full_window, long anglesDim, long detectorsDim, long i, long j); -DLL_EXPORT float RingWeights_angles2D(float *weights_temp, float *weights, int window_halfsize_angles, int angles_full_window, long anglesDim, long detectorsDim, long i, long j); -/************3D functions ***********/ -DLL_EXPORT float RingWeights_proj3D(float *residual, float *weights_temp, int window_halfsize_projections, int projections_full_window, long anglesDim, long detectorsDim, long slices, long j, long i, long k); -DLL_EXPORT float RingWeights_det3D(float *residual, float *weights_temp, int window_halfsize_detectors, int detectors_full_window, long anglesDim, long detectorsDim, long slices, long j, long i, long k); -DLL_EXPORT float RingWeights_angles3D(float *weights_temp, float *weights, int window_halfsize_angles, int angles_full_window, long anglesDim, long detectorsDim, long slices, long j, long i, long k); -#ifdef __cplusplus -} -#endif diff --git a/src/Core/include/dll_export.h b/src/Core/include/dll_export.h deleted file mode 100755 index d7b7179f1..000000000 --- a/src/Core/include/dll_export.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -CCP in Tomographic Imaging (CCPi) Core Imaging Library (CIL). - -Copyright 2017-2020 UKRI-STFC -Copyright 2017-2020 University of Manchester - -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. -*/ -#pragma once -#ifndef DLLEXPORT_H -#define DLLEXPORT_H - -#if defined(_WIN32) || defined(__WIN32__) -#if defined(dll_EXPORTS) // add by CMake -#define DLL_EXPORT __declspec(dllexport) -#define EXPIMP_TEMPLATE -#else -#define DLL_EXPORT __declspec(dllimport) -#define EXPIMP_TEMPLATE extern -#endif -#elif defined(linux) || defined(__linux) || defined(__APPLE__) -#define DLL_EXPORT -#ifndef __cdecl -#define __cdecl -#endif -#endif - -#endif diff --git a/src/Core/include/utils.h b/src/Core/include/utils.h deleted file mode 100644 index e6b06892e..000000000 --- a/src/Core/include/utils.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2019 Daniil Kazantsev - -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 -#include -#include "omp.h" -#include "dll_export.h" - -#ifdef __cplusplus -extern "C" { -#endif -DLL_EXPORT float copyIm(float *A, float *U, long dimX, long dimY, long dimZ); -DLL_EXPORT unsigned char copyIm_unchar(unsigned char *A, unsigned char *U, int dimX, int dimY, int dimZ); -#ifdef __cplusplus -} -#endif diff --git a/src/Python/CMakeLists.txt b/src/Python/CMakeLists.txt deleted file mode 100644 index 0796cca26..000000000 --- a/src/Python/CMakeLists.txt +++ /dev/null @@ -1,103 +0,0 @@ -cmake_minimum_required (VERSION 3.0) - -project(tomobarPython) - -# The version number. -message("Creating Python Wrapper") -# conda orchestrated build -message("tomobar_VERSION: ${tomobar_VERSION}") -#include (GenerateExportHeader) - -find_package(PythonInterp REQUIRED) -if (PYTHONINTERP_FOUND) - message ("Current Python " ${PYTHON_VERSION_STRING} " found " ${PYTHON_EXECUTABLE}) -endif() - - -message("CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}") -set(CMAKE_BUILD_TYPE "Release") - -if(WIN32) - set (FLAGS "/DWIN32 /EHsc /openmp ") - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:MSVCRT.lib") - - set (EXTRA_LIBRARIES) - - message("library lib: ${LIBRARY_LIB}") - -elseif(UNIX) - set (FLAGS "-fopenmp -O2 -funsigned-char -Wall -Wl,--no-undefined -std=c++0x") - set (EXTRA_LIBRARIES - "gomp" - ) -endif() - -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/setup-tomobar.py.in" "${CMAKE_CURRENT_BINARY_DIR}/setup-tomobar.py.in") - -find_package(PythonInterp) -find_package(PythonLibs) -if (PYTHONINTERP_FOUND) - message(STATUS "Found PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}") - message(STATUS "Python version ${PYTHON_VERSION_STRING}") -endif() -if (PYTHONLIBS_FOUND) - message(STATUS "Found PYTHON_INCLUDE_DIRS=${PYTHON_INCLUDE_DIRS}") - message(STATUS "Found PYTHON_LIBRARIES=${PYTHON_LIBRARIES}") -endif() - -if (PYTHONINTERP_FOUND) - message("Python found " ${PYTHON_EXECUTABLE}) - set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup-tomobar.py.in") - set(SETUP_PY "${CMAKE_CURRENT_BINARY_DIR}/setup-tomobar.py") - set (DEPS "${CMAKE_BINARY_DIR}/src/Core/") - set(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/build/timestamp") - - configure_file(${SETUP_PY_IN} ${SETUP_PY}) - - message("Core binary dir " ${CMAKE_BINARY_DIR}/Core/${CMAKE_BUILD_TYPE}) - - if (CONDA_BUILD) - add_custom_command(OUTPUT ${OUTPUT} - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/tomobar ${CMAKE_CURRENT_BINARY_DIR}/tomobar - COMMAND ${CMAKE_COMMAND} -E env tomobar_VERSION=${tomobar_VERSION} - PREFIX=${CMAKE_SOURCE_DIR}/src/Core - LIBRARY_INC=${CMAKE_SOURCE_DIR}/src/Core - LIBRARY_LIB=${CMAKE_BINARY_DIR}/src/Core - ${PYTHON_EXECUTABLE} ${SETUP_PY} install - COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT} - DEPENDS tomobar) - - else() - if (WIN32) - add_custom_command(OUTPUT ${OUTPUT} - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/tomobar ${CMAKE_CURRENT_BINARY_DIR}/tomobar - COMMAND ${CMAKE_COMMAND} -E env tomobar_VERSION=${tomobar_VERSION} - PREFIX=${CMAKE_SOURCE_DIR}/src/Core - LIBRARY_INC=${CMAKE_SOURCE_DIR}/src/Core - LIBRARY_LIB=${CMAKE_BINARY_DIR}/src/Core/${CMAKE_BUILD_TYPE} - ${PYTHON_EXECUTABLE} ${SETUP_PY} build_ext --inplace - COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT} - DEPENDS tomobar) - else() - add_custom_command(OUTPUT ${OUTPUT} - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/tomobar ${CMAKE_CURRENT_BINARY_DIR}/tomobar - COMMAND ${CMAKE_COMMAND} -E env tomobar_VERSION=${tomobar_VERSION} - PREFIX=${CMAKE_SOURCE_DIR}/src/Core - LIBRARY_INC=${CMAKE_SOURCE_DIR}/src/Core - LIBRARY_LIB=${CMAKE_BINARY_DIR}/src/Core - ${PYTHON_EXECUTABLE} ${SETUP_PY} build_ext --inplace - COMMAND ${CMAKE_COMMAND} -E touch ${OUTPUT} - DEPENDS tomobar) - endif() - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/tomobar - DESTINATION ${PYTHON_DEST}) - endif() - - - add_custom_target(PythonWrapper ALL DEPENDS ${OUTPUT}) - - #install(CODE "execute_process(COMMAND ${PYTHON} ${SETUP_PY} install)") -endif() diff --git a/src/Python/setup-tomobar.py.in b/src/Python/setup-tomobar.py.in deleted file mode 100644 index ba889e982..000000000 --- a/src/Python/setup-tomobar.py.in +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env python - -import setuptools -from distutils.core import setup -from distutils.extension import Extension -from Cython.Distutils import build_ext - -import os -import sys -import numpy -import platform - -tomobar_version=os.environ['VERSION'] -if tomobar_version == '': - print("Please set the environmental variable VERSION") - sys.exit(1) - -library_include_path = "" -library_lib_path = "" -try: - library_include_path = os.environ['LIBRARY_INC'] - library_lib_path = os.environ['LIBRARY_LIB'] -except: - library_include_path = os.environ['PREFIX']+'/include' - pass - -extra_include_dirs = [numpy.get_include(), library_include_path] -#extra_library_dirs = [os.path.join(library_include_path, "..", "lib")] -extra_compile_args = [] -extra_library_dirs = [library_lib_path] -extra_compile_args = [] -extra_link_args = [] -extra_libraries = ['tomobar'] - -print ("extra_library_dirs " , extra_library_dirs) - -extra_include_dirs += [os.path.join(".." , "Core"), - os.path.join(".." , "Core", "functions_CPU"), - "."] - -if platform.system() == 'Windows': - extra_compile_args[0:] = ['/DWIN32','/EHsc','/DBOOST_ALL_NO_LIB' , '/openmp' ] -else: - extra_compile_args = ['-fopenmp','-O2', '-funsigned-char', '-Wall', '-std=c++0x'] - extra_libraries += [@EXTRA_OMP_LIB@] - -setup( - name='tomobar', - author="Daniil Kazantsev", - author_email="daniil.kazantsev@diamond.ac.uk", - description="TOmographic MOdel-BAsed Reconstruction (ToMoBAR) software", - license="GPL v3", - keywords="iterative reconstruction framework", - url="https://github.com/dkazanc/ToMoBAR", - version=tomobar_version, - cmdclass = {'build_ext': build_ext}, - ext_modules = [Extension("tomobar.supp.addmodules", - sources=[os.path.join("." , "src", "cpu_wrappers.pyx") ], - include_dirs=extra_include_dirs, - library_dirs=extra_library_dirs, - extra_compile_args=extra_compile_args, - libraries=extra_libraries ), - - ], - zip_safe = False, - packages=['tomobar', 'tomobar.supp'], -) diff --git a/src/Python/src/cpu_wrappers.pyx b/src/Python/src/cpu_wrappers.pyx deleted file mode 100644 index 7a08c449f..000000000 --- a/src/Python/src/cpu_wrappers.pyx +++ /dev/null @@ -1,55 +0,0 @@ -# distutils: language=c++ -""" -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. -""" - -import cython -import numpy as np -cimport numpy as np - -cdef extern float RingWeights_main(float *residual, float *weights, int window_halfsize_detectors, int window_halfsize_angles, int window_halfsize_projections, long anglesDim, long detectorsDim, long slices); - -############################################################################## -def RING_WEIGHTS(residual, window_halfsize_detectors, window_halfsize_angles, window_halfsize_projections): - if residual.ndim == 2: - return RING_WEIGHTS_2D(residual, window_halfsize_detectors, window_halfsize_angles) - elif residual.ndim == 3: - return RING_WEIGHTS_3D(residual, window_halfsize_detectors, window_halfsize_angles, window_halfsize_projections) - -def RING_WEIGHTS_2D(np.ndarray[np.float32_t, ndim=2, mode="c"] residual, - int window_halfsize_detectors, - int window_halfsize_angles): - - cdef long dims[2] - dims[0] = residual.shape[0] - dims[1] = residual.shape[1] - - cdef np.ndarray[np.float32_t, ndim=2, mode="c"] weights = \ - np.zeros([dims[0],dims[1]], dtype='float32') - - RingWeights_main(&residual[0,0], &weights[0,0], window_halfsize_detectors, window_halfsize_angles, 0, dims[0], dims[1], 1); - return weights - -def RING_WEIGHTS_3D(np.ndarray[np.float32_t, ndim=3, mode="c"] residual, - int window_halfsize_detectors, - int window_halfsize_angles, - int window_halfsize_projections): - - cdef long dims[3] - dims[0] = residual.shape[0] - dims[1] = residual.shape[1] - dims[2] = residual.shape[2] - - cdef np.ndarray[np.float32_t, ndim=3, mode="c"] weights = \ - np.zeros([dims[0],dims[1],dims[2]], dtype='float32') - - RingWeights_main(&residual[0,0,0], &weights[0,0,0], window_halfsize_detectors, window_halfsize_angles, window_halfsize_projections, dims[1], dims[2], dims[0]); - return weights diff --git a/src/Python/temp/__init__.py b/src/Python/temp/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/Python/temp/read_hdf5.py b/src/Python/temp/read_hdf5.py deleted file mode 100644 index 2cc250a66..000000000 --- a/src/Python/temp/read_hdf5.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Created on Wed Aug 23 16:34:49 2017 -@author: ofn77899 -""" - -import h5py -import numpy - -def getEntry(nx, location): - for item in nx[location].keys(): - print (item) - -filename = r'/home/ofn77899/Reconstruction/CCPi-FISTA_Reconstruction/demos/DendrData.h5' -nx = h5py.File(filename, "r") -#getEntry(nx, '/') -# I have exported the entries as children of / -entries = [entry for entry in nx['/'].keys()] -print (entries) - -Sino3D = numpy.asarray(nx.get('/Sino3D')) -Weights3D = numpy.asarray(nx.get('/Weights3D')) -angSize = numpy.asarray(nx.get('/angSize'), dtype=int)[0] -angles_rad = numpy.asarray(nx.get('/angles_rad')) -recon_size = numpy.asarray(nx.get('/recon_size'), dtype=int)[0] -size_det = numpy.asarray(nx.get('/size_det'), dtype=int)[0] - -slices_tot = numpy.asarray(nx.get('/slices_tot'), dtype=int)[0] - -#from ccpi.viewer.CILViewer2D import CILViewer2D -#v = CILViewer2D() -#v.setInputAsNumpy(Weights3D) -#v.startRenderLoop() - -import matplotlib.pyplot as plt -fig = plt.figure() - -a=fig.add_subplot(1,1,1) -a.set_title('noise') -imgplot = plt.imshow(Weights3D[0].T) -plt.show() \ No newline at end of file diff --git a/src/Python/temp/smoothSignal.py b/src/Python/temp/smoothSignal.py deleted file mode 100644 index a38331f17..000000000 --- a/src/Python/temp/smoothSignal.py +++ /dev/null @@ -1,124 +0,0 @@ -#%% -from scipy.signal import savgol_filter -import numpy as np - -window_size=51 -polynomial_order=3 -x = np.linspace(0,2*np.pi,100) -y = np.sin(x) + np.random.random(100) * 0.8 - -#yhat = savgol_filter(x, window_size, polynomial_order) - -def smooth(y, box_pts): - box = np.ones(box_pts)/box_pts - y_smooth = np.convolve(y, box, mode='same') - return y_smooth - -import matplotlib.pyplot as plt -plt.figure() -plt.plot(x, y,'o') -plt.plot(x, smooth(y,3), 'r-', lw=2) -plt.plot(x, smooth(y,19), 'g-', lw=2) -#%% -import numpy - -def smooth(x,window_len=11,window='hanning'): - """smooth the data using a window with requested size. - - This method is based on the convolution of a scaled window with the signal. - The signal is prepared by introducing reflected copies of the signal - (with the window size) in both ends so that transient parts are minimized - in the begining and end part of the output signal. - - input: - x: the input signal - window_len: the dimension of the smoothing window; should be an odd integer - window: the type of window from 'flat', 'hanning', 'hamming', 'bartlett', 'blackman' - flat window will produce a moving average smoothing. - - output: - the smoothed signal - - example: - - t=linspace(-2,2,0.1) - x=sin(t)+randn(len(t))*0.1 - y=smooth(x) - - see also: - - numpy.hanning, numpy.hamming, numpy.bartlett, numpy.blackman, numpy.convolve - scipy.signal.lfilter - - TODO: the window parameter could be the window itself if an array instead of a string - NOTE: length(output) != length(input), to correct this: return y[(window_len/2-1):-(window_len/2)] instead of just y. - """ - - if (x.ndim != 1): - raise (ValueError, "smooth only accepts 1 dimension arrays.") - - if x.size < window_len: - raise (ValueError, "Input vector needs to be bigger than window size.") - - - if window_len<3: - return x - - - if not window in ['flat', 'hanning', 'hamming', 'bartlett', 'blackman']: - raise (ValueError, "Window is on of 'flat', 'hanning', 'hamming', 'bartlett', 'blackman'") - - - s=numpy.r_[x[window_len-1:0:-1],x,x[-2:-window_len-1:-1]] - #print(len(s)) - if window == 'flat': #moving average - w=numpy.ones(window_len,'d') - else: - w=eval('numpy.'+window+'(window_len)') - - y=numpy.convolve(w/w.sum(),s,mode='valid') - return y - - - - -from numpy import * -from pylab import * - -def smooth_demo(): - - t=linspace(-4,4,100) - x=sin(t) - xn=x+randn(len(t))*0.1 - y=smooth(x) - - ws=31 - - subplot(211) - plot(ones(ws)) - - windows=['flat', 'hanning', 'hamming', 'bartlett', 'blackman'] - - hold(True) - for w in windows[1:]: - eval('plot('+w+'(ws) )') - - axis([0,30,0,1.1]) - - legend(windows) - title("The smoothing windows") - subplot(212) - plot(x) - plot(xn) - for w in windows: - plot(smooth(xn,10,w)) - l=['original signal', 'signal with noise'] - l.extend(windows) - - legend(l) - title("Smoothing a noisy signal") - show() - - -if __name__=='__main__': - smooth_demo() diff --git a/src/Python/tomobar/__init__.py b/src/Python/tomobar/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/Python/tomobar/supp/__init__.py b/src/Python/tomobar/supp/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/test_tomobarCPU_DIR.py b/tests/test_tomobarCPU_DIR.py similarity index 100% rename from test/test_tomobarCPU_DIR.py rename to tests/test_tomobarCPU_DIR.py diff --git a/src/Python/__init__.py b/tomobar/__init__.py similarity index 100% rename from src/Python/__init__.py rename to tomobar/__init__.py diff --git a/src/Python/tomobar/__init__.pyc b/tomobar/__init__.pyc similarity index 100% rename from src/Python/tomobar/__init__.pyc rename to tomobar/__init__.pyc diff --git a/tomobar/__pycache__/__init__.cpython-310.pyc b/tomobar/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e519ffeb1329d9d5024d57302d1da74fad825cb2 GIT binary patch literal 146 zcmd1j<>g`kf+;^{B!lS3AOaaM0yz#qT+9L_QW%06G#UL?G8BP?5yUT3{fzwFRQ<%9 z^!yxsm;B_?+|<01Vtp6aF#V8x-+U*>ApMg3-29}(BK`RI%)HE!_;|g7%3B;Zx%nxj PIjMFa$hN>WKBsr(To`o|fiQcj$TiC)TFU;qqWnH3qJJqQ zF5=^!RuzRQ1%;_htEdGH-+D!@>V=p}d9g~onkXbxWp@IpcqLg)6;jonLQgeaNLPCc zz12)1Q|&ACRkMX`wZG6`9ViT_%3F%v7gMako#$1B{;eUFxUZ_p=M`JsR(2Djx8cG_ ztKRFaddWz=6zZiaqt&s(SOlios@v05H(eR8P8230b+=n}d)swchV{Lt6b`X0>&N#b z8(@R@KFo&LFusql5jKkNqt_HR#>U@M*!X>|aExioN^YWFjw#B#!L5>GyB@EXys~2( zrHbjg#;U_nuvV{_yzE-cD0>z+z4Bels9N5-!`zv4dV1Qp6{&Ld`t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U>8x*&9O6Fn!j@rZ6hX zA#btb0T*d>qR;k7WUUz31^6`n;G0 z%o18(X{0*mXjuv82&H#|(vBID?~ZdPmr6J+T7N{`M9jnZxHAXeQm`2CMU;$G3Sa6rcIQSt*#7~15)-#+A$!qaa4-Z!w<#4mr)F+jgavP(wb(Bepy zW-e45cX^|JEP> zx0m_*0zg5B3zEE0$zDMN>tONQh^OMR-?K zf|6vh$edEK$iG5Zf0cr-QD9T>9SZ&l1!7?BfJP@?hxLGvUD}u_C8nk>q>iWh@IRw` zDf5mf&ppBa8A|;)yryeA@*y3Oj9lOqiqZZq9HJlmnprK=Pp`Q%EjAnp`QVRO_m6+( z*Gr`t1b**z@xxByowp#T!myy%8A+})^2fFKKcYV4wH^E#7$;j@VZ8I@H)C?TT**_9 z5&R<*2oAYUF+sXjinXUj#Kg*{E=T|`(?)kmzKLn6QCeM1JA)A4Khkvima&0-v6P-l O;D1#4QmS`o=6?eX>`UbU literal 0 HcmV?d00001 diff --git a/src/Matlab/main_func/ADMM_REC.m b/tomobar/matlab/main_func/ADMM_REC.m similarity index 100% rename from src/Matlab/main_func/ADMM_REC.m rename to tomobar/matlab/main_func/ADMM_REC.m diff --git a/src/Matlab/main_func/FISTA_REC.m b/tomobar/matlab/main_func/FISTA_REC.m similarity index 100% rename from src/Matlab/main_func/FISTA_REC.m rename to tomobar/matlab/main_func/FISTA_REC.m diff --git a/src/Matlab/main_func/studentst.m b/tomobar/matlab/main_func/studentst.m similarity index 100% rename from src/Matlab/main_func/studentst.m rename to tomobar/matlab/main_func/studentst.m diff --git a/src/Matlab/supplementary/CCPi-Regularisation-Toolkit/Wrappers/Matlab/mex_compile/installed/MEXed_files_location.txt b/tomobar/matlab/supplementary/CCPi-Regularisation-Toolkit/Wrappers/Matlab/mex_compile/installed/MEXed_files_location.txt similarity index 100% rename from src/Matlab/supplementary/CCPi-Regularisation-Toolkit/Wrappers/Matlab/mex_compile/installed/MEXed_files_location.txt rename to tomobar/matlab/supplementary/CCPi-Regularisation-Toolkit/Wrappers/Matlab/mex_compile/installed/MEXed_files_location.txt diff --git a/src/Matlab/supplementary/RMSE.m b/tomobar/matlab/supplementary/RMSE.m similarity index 100% rename from src/Matlab/supplementary/RMSE.m rename to tomobar/matlab/supplementary/RMSE.m diff --git a/src/Matlab/supplementary/TomoPhantom/uncompress files here b/tomobar/matlab/supplementary/TomoPhantom/uncompress files here similarity index 100% rename from src/Matlab/supplementary/TomoPhantom/uncompress files here rename to tomobar/matlab/supplementary/TomoPhantom/uncompress files here diff --git a/src/Matlab/supplementary/spot/uncompress files here b/tomobar/matlab/supplementary/spot/uncompress files here similarity index 100% rename from src/Matlab/supplementary/spot/uncompress files here rename to tomobar/matlab/supplementary/spot/uncompress files here diff --git a/src/Python/tomobar/methodsDIR.py b/tomobar/methodsDIR.py similarity index 100% rename from src/Python/tomobar/methodsDIR.py rename to tomobar/methodsDIR.py diff --git a/src/Python/tomobar/methodsIR.py b/tomobar/methodsIR.py similarity index 99% rename from src/Python/tomobar/methodsIR.py rename to tomobar/methodsIR.py index ef070e3fe..cc042274d 100644 --- a/src/Python/tomobar/methodsIR.py +++ b/tomobar/methodsIR.py @@ -40,11 +40,6 @@ except ImportError: print('____! Wavelet package pywpt is missing, please install !____') -try: - from tomobar.supp.addmodules import RING_WEIGHTS -except ImportError: - print('____! RING_WEIGHTS C-module failed on import !____') - def smooth(y, box_pts): # a function to smooth 1D signal box = np.ones(box_pts)/box_pts diff --git a/src/Python/src/__init__.py b/tomobar/supp/__init__.py similarity index 100% rename from src/Python/src/__init__.py rename to tomobar/supp/__init__.py diff --git a/src/Python/tomobar/supp/__init__.pyc b/tomobar/supp/__init__.pyc similarity index 100% rename from src/Python/tomobar/supp/__init__.pyc rename to tomobar/supp/__init__.pyc diff --git a/tomobar/supp/__pycache__/__init__.cpython-310.pyc b/tomobar/supp/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4bc01bd526d48f8010f1171803bf0ff5407dbb8d GIT binary patch literal 151 zcmd1j<>g`kf+;^{B!lS3AOaaM0yz#qT+9L_QW%06G#UL?G8BP?5yUSm{fzwFRQ<%9 z^!yxsm;B_?+|<01Vtp6aF#V8x-+U*>ApMg3-29}(BK_jhf&%^c_{_Y_lK6PNg34PQ UHo5sJr8%i~ATx`ZfCLKz0Dq$*j{pDw literal 0 HcmV?d00001 diff --git a/tomobar/supp/__pycache__/astraOP.cpython-310.pyc b/tomobar/supp/__pycache__/astraOP.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ceb9c226626a5f3f4ee1b574d0e2a87c9d3e121a GIT binary patch literal 14357 zcmeHOTaX;rS?s1W|EJZNm?&ttzW8rnYJBc_P5UMv1}_T_7w`)r z5KpUVp6(efy=H7%k}_-N$F#PsYy9&wp1G^*+6$VO@v^UIwXA1(IovJJ_VT#rynET4?(^P-r+4{NyJqbWo{xL)#`C-7c^c1-cR!x*_sb|hjOP>HNj#sF=NZpf z)+!IUAJ#Q(*;h?Ja5}3_qvZwxlHoNsbY4>K=4P|K=3HF9a`~bYb~>$<&dazvo4#7@ zs10XRb=Lhx*zB}tSKP++{$s&ydyeuOopunaEvdog@o%m=J70A+UFEh~e#=?$-3`Zc zL-%Z<@Z{1nH|L#Jv*EV`-+Av)ua&|DcPqTsQ4c#+x7}>EoR7HMZaWP8n-4qJ!f-Qq zcy@NJ8D863Ios%L%zD>Z+$dbS=C;@TR%h+uf`jYa2hX1Sz}dMu=Zv%Au6LBPxVVII zax!knsbYi}Sh^0JhUBV#ozf1T9=RiVjPsh*bYPWee zc`s^fMv_j-){Hgdw!WkIpt$Y^gySyw6dR%A9hL1d!)eLc#C*Zk1k*AxZdjfZBh zbvFE2x3$)3%~m^&tqmV*I$M4G>g<)yvz^B-UY-p*8=Vzb%?4YWo3k#bx43k6^Hy|7 zbwaFJr(MU=spiXb)x#VxCFiI|vB*1*cb+?cnfdB&@_bB+~r z;ag}xu8OH9kPy<#{MSd7$t;_MGmS|RsXGQfUps&Ssnm(l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ln@E$&y?<*$;w zO43&seHQ&P3jUldN=+NHD43JE2QsJn5tPDK4lvwER4|VU?2J45I$fP{))Lqq|6}3~ zd-+ZW&tk6Jk5N;6ocH!_`8fXlJFJoz(&L#y4jy#62Tdu{DJrJ?$DbS0aNah-4lKvF zSwuFmg^a(`!a<6h%g$E^wo7D)isZDt;Od=@@{JVuikM zLZLsF;#eA(WK?4DdS8!y68WP8qEh^aWI(WR@qtS+poBRO9FY2Lw)s0C_&!yZL9pT1 z@9ZfmC5_RC`A2lAeh;;J{>f;EtTQC8Dc)6)vm}fmGZx^^WQ>ZkcSt+1gRXugpYQg@UVQLIVj0J14B_#WZYy3!nk5!MutF> z@a>e5VmH5MjxmHp*zjH8ud&Jg%YFX%V-)-|`D4Ir7>c=-yP{mZ?sXbC%F5zn+$~skq`RiQ`h+Oyjgbj5Xn;{&yswU Date: Sat, 11 Mar 2023 17:35:58 +0000 Subject: [PATCH 02/10] enabling actions --- .github/workflows/tomobar_conda_upload.yml | 43 +++++++++ .github/workflows/ubuntu.yml | 88 ------------------ .scripts/conda_upload.sh | 10 +- conda-recipe/bld.bat | 11 +-- conda-recipe/build.sh | 3 + conda-recipe/environment/environment.yml | 20 ++++ conda-recipe/meta.yaml | 1 - tomobar/__init__.py | 3 + tomobar/__pycache__/__init__.cpython-310.pyc | Bin 146 -> 0 bytes tomobar/__pycache__/methodsIR.cpython-310.pyc | Bin 20967 -> 0 bytes 10 files changed, 76 insertions(+), 103 deletions(-) create mode 100644 .github/workflows/tomobar_conda_upload.yml delete mode 100644 .github/workflows/ubuntu.yml create mode 100755 conda-recipe/build.sh create mode 100644 conda-recipe/environment/environment.yml delete mode 100644 tomobar/__pycache__/__init__.cpython-310.pyc delete mode 100644 tomobar/__pycache__/methodsIR.cpython-310.pyc diff --git a/.github/workflows/tomobar_conda_upload.yml b/.github/workflows/tomobar_conda_upload.yml new file mode 100644 index 000000000..114ce19b5 --- /dev/null +++ b/.github/workflows/tomobar_conda_upload.yml @@ -0,0 +1,43 @@ +name: tomobar_conda_upload + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build-linux: + runs-on: ubuntu-latest + + defaults: + run: + shell: bash -l {0} + + steps: + - name: Checkout repository code + uses: actions/checkout@v2 + + # setup Python 3.10 + - name: Setup Python 3.10 + uses: actions/setup-python@v2 + with: + python-version: 3.10 + + - name: Install dependencies with Conda + run: | + $CONDA/bin/conda env update --file conda-recipe/environment/environment.yml --name base + conda config --set anaconda_upload no + export VERSION=`date +%Y.%m` + + - name: Decrypt a secret + run: ./.scripts/decrypt_secret.sh + env: + LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} + + - name: Upload the tested package to conda cloud + run: | + chmod +x ./.scripts/conda_upload.sh + ./.scripts/conda_upload.sh diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml deleted file mode 100644 index 4d59fda83..000000000 --- a/.github/workflows/ubuntu.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: linux - -on: [push] - -jobs: - build-linux: - runs-on: ${{ matrix.os }} - strategy: - matrix: - include: - # 18.04 supports CUDA 10.1+ (gxx <= 8) - - os: ubuntu-18.04 - cuda: "10.1" - gcc: 8 - max-parallel: 5 - env: - build_dir: "build" - config: "Release" - steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - # Specify the correct host compilers - - name: Install/Select gcc and g++ - run: | - sudo apt-get install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }} - echo "CC=/usr/bin/gcc-${{ matrix.gcc }}" >> $GITHUB_ENV - echo "CXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV - - name: Configure cmake - id: configure - run: cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} - - - name: Configure Error Processing - if: ${{ failure() && steps.configure.outcome == 'failure' }} - working-directory: ${{ env.build_dir }} - run: | - if [[ -f "CMakeFiles/CMakeOutput.log" ]]; then - echo "---- CMakeFiles/CMakeOutput.log" - cat CMakeFiles/CMakeOutput.log - echo "----" - fi - if [[ -f "CMakeFiles/CMakeError.log" ]]; then - echo "---- CMakeFiles/CMakeError.log" - cat CMakeFiles/CMakeError.log - echo "----" - fi - - - name: Install dependencies in conda environment - run: | - # $CONDA is an environment variable pointing to the root of the miniconda directory - $CONDA/bin/conda env update --file environment.yml --name base - - - name: Lint with flake8 - run: | - $CONDA/bin/conda install flake8 - # stop the build if there are Python syntax errors or undefined names - $CONDA/bin/flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - $CONDA/bin/flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - - name: Install additional conda packages - run: | - conda install --yes numpy conda-build anaconda-client setuptools cython cmake - - - name: Building and installing the ToMoBAR package - run: | - conda config --set anaconda_upload no - export VERSION=`date +%Y.%m` - conda build conda-recipe/ --numpy=1.15 --python=3.7 - conda install --channel /usr/share/miniconda/conda-bld/ tomobar --offline --override-channels --force-reinstall - - - name: Test with pytest - run: | - conda install pytest - $CONDA/bin/pytest - - - name: Decrypt a secret - run: ./scripts/decrypt_secret.sh - env: - LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} - - - name: Upload the tested package to conda cloud - run: | - chmod +x ./scripts/conda_upload.sh - ./scripts/conda_upload.sh diff --git a/.scripts/conda_upload.sh b/.scripts/conda_upload.sh index 8a28d3655..6d0650d0d 100755 --- a/.scripts/conda_upload.sh +++ b/.scripts/conda_upload.sh @@ -10,12 +10,12 @@ conda config --set anaconda_upload no export CONDA_BLD_PATH=~/conda-bld export VERSION=`date +%Y.%m` conda install --yes anaconda-client -conda build . --numpy=1.15 --python=3.5 -conda build . --numpy=1.15 --python=3.6 -conda build . --numpy=1.15 --python=3.7 -conda build . --numpy=1.21 --python=3.7 -conda build . --numpy=1.18 --python=3.8 +conda build . --numpy=1.20 --python=3.9 conda build . --numpy=1.21 --python=3.9 +conda build . --numpy=1.22 --python=3.9 +conda build . --numpy=1.20 --python=3.10 +conda build . --numpy=1.21 --python=3.10 +conda build . --numpy=1.22 --python=3.10 # upload packages to conda find $CONDA_BLD_PATH/$OS -name *.tar.bz2 | while read file diff --git a/conda-recipe/bld.bat b/conda-recipe/bld.bat index 5d51da2f0..713f54f4e 100755 --- a/conda-recipe/bld.bat +++ b/conda-recipe/bld.bat @@ -3,12 +3,5 @@ ECHO VERSION Not Defined. exit 1 ) -mkdir "%SRC_DIR%\test" -ROBOCOPY /E "%RECIPE_DIR%\..\test" "%SRC_DIR%\test" -cd %SRC_DIR% - -:: issue cmake to create setup.py -cmake -G "NMake Makefiles" %RECIPE_DIR%\..\ -DBUILD_PYTHON_WRAPPERS=ON -DCONDA_BUILD=ON -DCMAKE_BUILD_TYPE="Release" -DLIBRARY_LIB="%CONDA_PREFIX%\lib" -DLIBRARY_INC="%CONDA_PREFIX%" -DCMAKE_INSTALL_PREFIX="%PREFIX%\Library" - -nmake install -if errorlevel 1 exit 1 +"%PYTHON%" -m pip install -e . +if errorlevel 1 exit 1 \ No newline at end of file diff --git a/conda-recipe/build.sh b/conda-recipe/build.sh new file mode 100755 index 000000000..c3e414dd3 --- /dev/null +++ b/conda-recipe/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +python -m pip install -e . \ No newline at end of file diff --git a/conda-recipe/environment/environment.yml b/conda-recipe/environment/environment.yml new file mode 100644 index 000000000..56fbe1457 --- /dev/null +++ b/conda-recipe/environment/environment.yml @@ -0,0 +1,20 @@ +name: tomobar +channels: + - conda-forge + - anaconda +dependencies: + - conda-forge::numpy + - conda-forge::scipy + - conda-forge::python + - conda-forge::pytest + - conda-forge::pytest-xdist + - conda-forge::pytest-cov + - conda-forge::flake8 + - conda-forge::pyproject-flake8 + - conda-forge::pydocstyle + - conda-forge::imageio + - conda-forge::toml + - conda-forge::setuptools + - anaconda::ipython + - anaconda::conda-build + - anaconda::anaconda-client diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index d68ff2012..69ffde579 100755 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -10,7 +10,6 @@ source: build: preserve_egg_dir: False number: 0 - script: {{ PYTHON }} -m pip install --no-deps --ignore-installed . requirements: host: diff --git a/tomobar/__init__.py b/tomobar/__init__.py index e69de29bb..9f231fd77 100644 --- a/tomobar/__init__.py +++ b/tomobar/__init__.py @@ -0,0 +1,3 @@ +from tomobar.supp.astraOP import AstraTools +from tomobar.methodsIR import RecToolsIR +from tomobar.methodsDIR import RecToolsDIR \ No newline at end of file diff --git a/tomobar/__pycache__/__init__.cpython-310.pyc b/tomobar/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index e519ffeb1329d9d5024d57302d1da74fad825cb2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 146 zcmd1j<>g`kf+;^{B!lS3AOaaM0yz#qT+9L_QW%06G#UL?G8BP?5yUT3{fzwFRQ<%9 z^!yxsm;B_?+|<01Vtp6aF#V8x-+U*>ApMg3-29}(BK`RI%)HE!_;|g7%3B;Zx%nxj PIjMFa$hN>WKBsr(To`o|fiQcj$TiC)TFU;qqWnH3qJJqQ zF5=^!RuzRQ1%;_htEdGH-+D!@>V=p}d9g~onkXbxWp@IpcqLg)6;jonLQgeaNLPCc zz12)1Q|&ACRkMX`wZG6`9ViT_%3F%v7gMako#$1B{;eUFxUZ_p=M`JsR(2Djx8cG_ ztKRFaddWz=6zZiaqt&s(SOlios@v05H(eR8P8230b+=n}d)swchV{Lt6b`X0>&N#b z8(@R@KFo&LFusql5jKkNqt_HR#>U@M*!X>|aExioN^YWFjw#B#!L5>GyB@EXys~2( zrHbjg#;U_nuvV{_yzE-cD0>z+z4Bels9N5-!`zv4dV1Qp6{&Ld`tt30!>p`1yzH%4 zjj8z=w@Z%cyZ@rD9dx{NsQxU!Q-&c+IJE+pHLvfa_Irji4`=%9dTS z+`MtusmvI2dBb*QjI(*8R>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nZxHAXeQm`2CMU;$G3Sa6rcIQSt*#7~15)-#+A$!qaa4-Z!w<#4mr)F+jgavP(wb(Bepy zW-e45cX^|JEP> zx0m_*0zg5B3zEE0$zDMN>tONQh^OMR-?K zf|6vh$edEK$iG5Zf0cr-QD9T>9SZ&l1!7?BfJP@?hxLGvUD}u_C8nk>q>iWh@IRw` zDf5mf&ppBa8A|;)yryeA@*y3Oj9lOqiqZZq9HJlmnprK=Pp`Q%EjAnp`QVRO_m6+( z*Gr`t1b**z@xxByowp#T!myy%8A+})^2fFKKcYV4wH^E#7$;j@VZ8I@H)C?TT**_9 z5&R<*2oAYUF+sXjinXUj#Kg*{E=T|`(?)kmzKLn6QCeM1JA)A4Khkvima&0-v6P-l O;D1#4QmS`o=6?eX>`UbU From 3b8ca4c7b2743ed696e076face8e1990570a8a3b Mon Sep 17 00:00:00 2001 From: Daniil Kazantsev Date: Sat, 11 Mar 2023 17:43:55 +0000 Subject: [PATCH 03/10] actions1 --- .github/workflows/tomobar_conda_upload.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/tomobar_conda_upload.yml b/.github/workflows/tomobar_conda_upload.yml index 114ce19b5..9757c7001 100644 --- a/.github/workflows/tomobar_conda_upload.yml +++ b/.github/workflows/tomobar_conda_upload.yml @@ -1,12 +1,6 @@ name: tomobar_conda_upload -on: - push: - branches: - - main - pull_request: - branches: - - main +on: [push, pull_request, pull_request_target] jobs: build-linux: From 9a9d5677f2ba8e9c931928831af0cbe5d8a133b4 Mon Sep 17 00:00:00 2001 From: Daniil Kazantsev Date: Sat, 11 Mar 2023 17:46:35 +0000 Subject: [PATCH 04/10] actions2 --- .github/workflows/tomobar_conda_upload.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tomobar_conda_upload.yml b/.github/workflows/tomobar_conda_upload.yml index 9757c7001..59e9ef207 100644 --- a/.github/workflows/tomobar_conda_upload.yml +++ b/.github/workflows/tomobar_conda_upload.yml @@ -12,11 +12,10 @@ jobs: steps: - name: Checkout repository code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - # setup Python 3.10 - name: Setup Python 3.10 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.10 From 5038a899b32b545cb14ad94726b91ae2c4389577 Mon Sep 17 00:00:00 2001 From: Daniil Kazantsev Date: Sat, 11 Mar 2023 17:52:14 +0000 Subject: [PATCH 05/10] actions3 --- .github/workflows/tomobar_conda_upload.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tomobar_conda_upload.yml b/.github/workflows/tomobar_conda_upload.yml index 59e9ef207..21ca31fcb 100644 --- a/.github/workflows/tomobar_conda_upload.yml +++ b/.github/workflows/tomobar_conda_upload.yml @@ -11,13 +11,16 @@ jobs: shell: bash -l {0} steps: - - name: Checkout repository code - uses: actions/checkout@v3 - - - name: Setup Python 3.10 - uses: actions/setup-python@v4 - with: - python-version: 3.10 + - uses: conda-incubator/setup-miniconda@v2 + with: + miniconda-version: latest + activate-environment: tomobar + python-version: 3.10 + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: '3.10' - name: Install dependencies with Conda run: | From a173c963c19da2ec030eb3ff21d238a86684bbc7 Mon Sep 17 00:00:00 2001 From: Daniil Kazantsev Date: Sat, 11 Mar 2023 17:55:48 +0000 Subject: [PATCH 06/10] actions4 --- .github/workflows/tomobar_conda_upload.yml | 31 +++++++++------------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/workflows/tomobar_conda_upload.yml b/.github/workflows/tomobar_conda_upload.yml index 21ca31fcb..292a8283a 100644 --- a/.github/workflows/tomobar_conda_upload.yml +++ b/.github/workflows/tomobar_conda_upload.yml @@ -11,29 +11,24 @@ jobs: shell: bash -l {0} steps: - - uses: conda-incubator/setup-miniconda@v2 - with: - miniconda-version: latest - activate-environment: tomobar - python-version: 3.10 - uses: actions/checkout@v3 - name: Set up Python 3.10 uses: actions/setup-python@v3 with: python-version: '3.10' - - name: Install dependencies with Conda - run: | - $CONDA/bin/conda env update --file conda-recipe/environment/environment.yml --name base - conda config --set anaconda_upload no - export VERSION=`date +%Y.%m` + - name: Install dependencies with Conda + run: | + $CONDA/bin/conda env update --file conda-recipe/environment/environment.yml --name base + conda config --set anaconda_upload no + export VERSION=`date +%Y.%m` - - name: Decrypt a secret - run: ./.scripts/decrypt_secret.sh - env: - LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} + - name: Decrypt a secret + run: ./.scripts/decrypt_secret.sh + env: + LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} - - name: Upload the tested package to conda cloud - run: | - chmod +x ./.scripts/conda_upload.sh - ./.scripts/conda_upload.sh + - name: Upload the tested package to conda cloud + run: | + chmod +x ./.scripts/conda_upload.sh + ./.scripts/conda_upload.sh From af0a4cf4a944949ff48f579d74717a2995439c4d Mon Sep 17 00:00:00 2001 From: Daniil Kazantsev Date: Sat, 11 Mar 2023 18:08:24 +0000 Subject: [PATCH 07/10] actions5 --- .scripts/conda_upload.sh | 2 +- .scripts/decrypt_secret.sh | 2 +- conda-recipe/environment/environment.yml | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.scripts/conda_upload.sh b/.scripts/conda_upload.sh index 6d0650d0d..6159f6d57 100755 --- a/.scripts/conda_upload.sh +++ b/.scripts/conda_upload.sh @@ -3,7 +3,7 @@ PKG_NAME=tomobar USER=dkazanc OS=linux-64 -CONDA_TOKEN=$(cat $HOME/secrets/my_secret.json) +CONDA_TOKEN=$(cat $HOME/.secrets/my_secret.json) mkdir ~/conda-bld conda config --set anaconda_upload no diff --git a/.scripts/decrypt_secret.sh b/.scripts/decrypt_secret.sh index 4f8065f19..7a367758e 100755 --- a/.scripts/decrypt_secret.sh +++ b/.scripts/decrypt_secret.sh @@ -5,4 +5,4 @@ mkdir $HOME/secrets # --batch to prevent interactive command # --yes to assume "yes" for questions gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" \ ---output $HOME/secrets/my_secret.json ./scripts/my_secret.json.gpg +--output $HOME/.secrets/my_secret.json ./.scripts/my_secret.json.gpg diff --git a/conda-recipe/environment/environment.yml b/conda-recipe/environment/environment.yml index 56fbe1457..ec4ef0a34 100644 --- a/conda-recipe/environment/environment.yml +++ b/conda-recipe/environment/environment.yml @@ -4,7 +4,6 @@ channels: - anaconda dependencies: - conda-forge::numpy - - conda-forge::scipy - conda-forge::python - conda-forge::pytest - conda-forge::pytest-xdist @@ -12,8 +11,6 @@ dependencies: - conda-forge::flake8 - conda-forge::pyproject-flake8 - conda-forge::pydocstyle - - conda-forge::imageio - - conda-forge::toml - conda-forge::setuptools - anaconda::ipython - anaconda::conda-build From c34d0b0492be99a0eec63b8b7b200e9a6a267ef9 Mon Sep 17 00:00:00 2001 From: Daniil Kazantsev Date: Sat, 11 Mar 2023 18:13:41 +0000 Subject: [PATCH 08/10] actions6 --- .scripts/decrypt_secret.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.scripts/decrypt_secret.sh b/.scripts/decrypt_secret.sh index 7a367758e..db5192c1e 100755 --- a/.scripts/decrypt_secret.sh +++ b/.scripts/decrypt_secret.sh @@ -1,7 +1,7 @@ #!/bin/sh # Decrypt the file -mkdir $HOME/secrets +mkdir $HOME/.secrets # --batch to prevent interactive command # --yes to assume "yes" for questions gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" \ From e9b989594ae52bcb5728a42afb2d45de5bef7763 Mon Sep 17 00:00:00 2001 From: Daniil Kazantsev Date: Sat, 11 Mar 2023 18:27:48 +0000 Subject: [PATCH 09/10] switch off tests temporarily --- conda-recipe/meta.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 69ffde579..bbcbe34a7 100755 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -24,15 +24,15 @@ requirements: - pillow - scikit-image - pytest -test: - requires: - - pip - - pytest - source_files: - - tests/* - commands: - - pip check - - pytest +# test: +# requires: +# - pip +# - pytest +# source_files: +# - tests/* +# commands: +# - pip check +# - pytest about: home: https://github.com/dkazanc/ToMoBAR From d06aea20512368e59fa6e50b2184e40f0abdab61 Mon Sep 17 00:00:00 2001 From: Daniil Kazantsev Date: Tue, 21 Mar 2023 16:17:38 +0000 Subject: [PATCH 10/10] completing setup, cleanup --- .github/workflows/tomobar_conda_upload.yml | 4 +-- .scripts/conda_upload.sh | 23 +++++++++------ Demos/Python/DemoFISTA_artifacts3D.py | 27 ------------------ Readme.md | 1 - conda-recipe/bld.bat | 2 +- conda-recipe/build.sh | 2 +- conda-recipe/conda_build_config.yaml | 4 +-- conda-recipe/meta.yaml | 24 +++++++++------- pyproject.toml | 3 +- tomobar/__init__.pyc | Bin 137 -> 0 bytes tomobar/methodsIR.py | 26 +---------------- tomobar/supp/__init__.pyc | Bin 137 -> 0 bytes .../supp/__pycache__/__init__.cpython-310.pyc | Bin 151 -> 0 bytes .../supp/__pycache__/astraOP.cpython-310.pyc | Bin 14357 -> 0 bytes 14 files changed, 35 insertions(+), 81 deletions(-) delete mode 100644 tomobar/__init__.pyc delete mode 100644 tomobar/supp/__init__.pyc delete mode 100644 tomobar/supp/__pycache__/__init__.cpython-310.pyc delete mode 100644 tomobar/supp/__pycache__/astraOP.cpython-310.pyc diff --git a/.github/workflows/tomobar_conda_upload.yml b/.github/workflows/tomobar_conda_upload.yml index 292a8283a..038482b57 100644 --- a/.github/workflows/tomobar_conda_upload.yml +++ b/.github/workflows/tomobar_conda_upload.yml @@ -1,6 +1,6 @@ name: tomobar_conda_upload -on: [push, pull_request, pull_request_target] +on: [push] jobs: build-linux: @@ -20,8 +20,6 @@ jobs: - name: Install dependencies with Conda run: | $CONDA/bin/conda env update --file conda-recipe/environment/environment.yml --name base - conda config --set anaconda_upload no - export VERSION=`date +%Y.%m` - name: Decrypt a secret run: ./.scripts/decrypt_secret.sh diff --git a/.scripts/conda_upload.sh b/.scripts/conda_upload.sh index 6159f6d57..1706f9e42 100755 --- a/.scripts/conda_upload.sh +++ b/.scripts/conda_upload.sh @@ -8,14 +8,21 @@ CONDA_TOKEN=$(cat $HOME/.secrets/my_secret.json) mkdir ~/conda-bld conda config --set anaconda_upload no export CONDA_BLD_PATH=~/conda-bld -export VERSION=`date +%Y.%m` -conda install --yes anaconda-client -conda build . --numpy=1.20 --python=3.9 -conda build . --numpy=1.21 --python=3.9 -conda build . --numpy=1.22 --python=3.9 -conda build . --numpy=1.20 --python=3.10 -conda build . --numpy=1.21 --python=3.10 -conda build . --numpy=1.22 --python=3.10 +#export VERSION=`date +%Y.%m` +#conda install --yes anaconda-client +#conda build . --numpy=1.20 --python=3.9 +#conda build . --numpy=1.21 --python=3.9 +#conda build . --numpy=1.22 --python=3.9 +#conda build . --numpy=1.20 --python=3.10 +#conda build . --numpy=1.21 --python=3.10 +#conda build . --numpy=1.22 --python=3.10 + +for python_ver in 3.9 3.10; do + for numpy_ver in 1.21 1.22 1.23 1.24; do + export VERSION=`date +%Y.%m`"-py"$python_ver"_np"$numpy_ver + conda build . --numpy $numpy_ver --python $python_ver + done +done # upload packages to conda find $CONDA_BLD_PATH/$OS -name *.tar.bz2 | while read file diff --git a/Demos/Python/DemoFISTA_artifacts3D.py b/Demos/Python/DemoFISTA_artifacts3D.py index 4d935fe50..df6413333 100644 --- a/Demos/Python/DemoFISTA_artifacts3D.py +++ b/Demos/Python/DemoFISTA_artifacts3D.py @@ -255,33 +255,6 @@ plt.title('3D Huber Rec, sagittal') plt.show() -# adding RING minimisation component (better model for data with rings - different from GH!) -#data.update({'huber_threshold' : None}) -_data_.update({'ring_weights_threshold' : 2.0}) -_data_.update({'ring_tuple_halfsizes' : (9,7,9)}) - -# Run FISTA reconstrucion algorithm with 3D regularisation and a better ring model -RecFISTA_HuberRING_TV = Rectools.FISTA(_data_, _algorithm_, _regularisation_) - -Qtools = QualityTools(phantom_tm, RecFISTA_HuberRING_TV) -RMSE_FISTA_HUBER_RING_TV = Qtools.rmse() -print("RMSE for FISTA-OS-Huber-Ring-TV is {}".format(RMSE_FISTA_HUBER_RING_TV)) - -sliceSel = int(0.5*N_size) -max_val = 1 -plt.figure() -plt.subplot(131) -plt.imshow(RecFISTA_HuberRING_TV[sliceSel,:,:],vmin=0, vmax=max_val) -plt.title('3D HuberRing Rec, axial') - -plt.subplot(132) -plt.imshow(RecFISTA_HuberRING_TV[:,sliceSel,:],vmin=0, vmax=max_val) -plt.title('3D HuberRing Rec, coronal') - -plt.subplot(133) -plt.imshow(RecFISTA_HuberRING_TV[:,:,sliceSel],vmin=0, vmax=max_val) -plt.title('3D HuberRing Rec, sagittal') -plt.show() #%% print ("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%") print ("Reconstructing with FISTA-OS-SWLS-TV using tomobar") diff --git a/Readme.md b/Readme.md index 00e6ca844..596aa2f3f 100644 --- a/Readme.md +++ b/Readme.md @@ -63,7 +63,6 @@ conda install -c savu-dep tomobar export VERSION=`date +%Y.%m` (unix) / set VERSION=2020.10 (Windows) conda build conda-recipe/ --numpy 1.15 --python 3.7 conda install -c file://${CONDA_PREFIX}/conda-bld/ tomobar --force-reinstall -conda install tomobar --use-local --force-reinstall # if Python2 ``` ### Python development environment diff --git a/conda-recipe/bld.bat b/conda-recipe/bld.bat index 713f54f4e..f1098f234 100755 --- a/conda-recipe/bld.bat +++ b/conda-recipe/bld.bat @@ -3,5 +3,5 @@ ECHO VERSION Not Defined. exit 1 ) -"%PYTHON%" -m pip install -e . +"%PYTHON%" -m pip install . if errorlevel 1 exit 1 \ No newline at end of file diff --git a/conda-recipe/build.sh b/conda-recipe/build.sh index c3e414dd3..bdfbf848a 100755 --- a/conda-recipe/build.sh +++ b/conda-recipe/build.sh @@ -1,3 +1,3 @@ #!/bin/bash -python -m pip install -e . \ No newline at end of file +python -m pip install . diff --git a/conda-recipe/conda_build_config.yaml b/conda-recipe/conda_build_config.yaml index 202298a3a..ae0826f44 100755 --- a/conda-recipe/conda_build_config.yaml +++ b/conda-recipe/conda_build_config.yaml @@ -1,4 +1,4 @@ python: - 3.10 -numpy: - - 1.22 \ No newline at end of file +numpy: + - 1.24 \ No newline at end of file diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index bbcbe34a7..74f8e3ace 100755 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -5,12 +5,22 @@ package: version: {{ environ['VERSION'] }} source: - path: .. + path: ../ build: preserve_egg_dir: False number: 0 +test: + requires: + - pip + - pytest + source_files: + - tests/* + commands: + - pip check + - pytest + requirements: host: - python @@ -24,15 +34,7 @@ requirements: - pillow - scikit-image - pytest -# test: -# requires: -# - pip -# - pytest -# source_files: -# - tests/* -# commands: -# - pip check -# - pytest + about: home: https://github.com/dkazanc/ToMoBAR @@ -41,4 +43,4 @@ about: A collection of direct and iterative methods for parallel beam tomography extra: recipe-maintainers: - - dkazanc \ No newline at end of file + - dkazanc diff --git a/pyproject.toml b/pyproject.toml index 9130792c3..19e9f509f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=42", "wheel", "setuptools-git-versioning"] build-backend = "setuptools.build_meta" [tool.setuptools] -packages = ["tomobar"] +packages = ["tomobar", "tomobar.supp"] [tool.setuptools-git-versioning] enabled = true @@ -45,7 +45,6 @@ dev = [ "h5py" ] - [project.urls] "Repository" = "https://github.com/dkazanc/ToMoBAR" diff --git a/tomobar/__init__.pyc b/tomobar/__init__.pyc deleted file mode 100644 index 3b38194c438d6f6419229635791a9e7c24c5ac41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 137 zcmZSn%*!?V<+tc$1}I 1 more strength if 'ring_huber_power' not in _data_: _data_['ring_huber_power'] = 1.75 - # a tuple for half window sizes as [detector, angles, number of projections] - if 'ring_tuple_halfsizes' not in _data_: - _data_['ring_tuple_halfsizes'] = (9,7,9) # Group-Huber data model to supress full rings of the same intensity if 'ringGH_lambda' not in _data_: _data_['ringGH_lambda'] = None @@ -278,9 +272,7 @@ class RecToolsIR: --OS_number # the number of subsets, if None or 1 - classical (full data) algorithm --huber_threshold # threshold for Huber function to apply to data model (supress outliers) --studentst_threshold # threshold for Students't function to apply to data model (supress outliers) - --ring_weights_threshold # threshold to produce additional weights to supress ring artifacts --ring_huber_power # defines the strength of Huber penalty to supress artifacts 1 = Huber, > 1 more penalising - --ring_tuple_halfsizes # a tuple for half window sizes as [detector, angles, num of projections] --ringGH_lambda # a parameter for Group-Huber data model to supress full rings of the same intensity --ringGH_accelerate # Group-Huber data model acceleration factor (use carefully to avoid divergence, 50 default) --beta_SWLS # a regularisation parameter for stripe-weighted LS model (given as a vector size of DetectorsDimH) @@ -482,12 +474,6 @@ def FISTA(self, _data_, _algorithm_, _regularisation_): else: r = r_x - np.multiply(L_const_inv,vec) - if ((_data_['OS_number'] != 1) and (_data_['ring_weights_threshold'] is not None) and (iter_no > 0)): - # Ordered subset approach for a better ring model - res_full = self.Atools.forwproj(X_t) - _data_['projection_norm_data'] - rings_weights = RING_WEIGHTS(np.float32(res_full), _data_['ring_tuple_halfsizes'][0], _data_['ring_tuple_halfsizes'][1], _data_['ring_tuple_halfsizes'][2]) - ring_function_weight = np.ones(np.shape(res_full)) - ring_function_weight[(np.where(np.abs(rings_weights) > _data_['ring_weights_threshold']))] = np.divide(_data_['ring_weights_threshold'], np.abs(rings_weights[(np.where(np.abs(rings_weights) > _data_['ring_weights_threshold']))])**_data_['ring_huber_power']) # loop over subsets (OS) for sub_ind in range(_data_['OS_number']): X_old = X @@ -519,8 +505,6 @@ def FISTA(self, _data_, _algorithm_, _regularisation_): # ring removal part for Group-Huber (GH) fidelity (2D) if ((_data_['ringGH_lambda'] is not None) and (iter_no > 0)): res[:,0:None] = res[:,0:None] + _data_['ringGH_accelerate']*r_x[:,0] - if ((_data_['ring_weights_threshold'] is not None) and (iter_no > 0)): - res = np.multiply(ring_function_weight[indVec,:],res) else: # 3D if (self.datafidelity == 'LS'): # 3D Least-squares (LS) data fidelity - OS (linear) @@ -543,8 +527,6 @@ def FISTA(self, _data_, _algorithm_, _regularisation_): if ((_data_['ringGH_lambda'] is not None) and (iter_no > 0)): for ang_index in range(len(indVec)): res[:,ang_index,:] = res[:,ang_index,:] + _data_['ringGH_accelerate']*r_x - if ((_data_['ring_weights_threshold'] is not None) and (iter_no > 0)): - res = np.multiply(ring_function_weight[:,indVec,:],res) else: # CLASSICAL all-data approach if (self.datafidelity == 'LS'): # full residual for LS fidelity @@ -566,12 +548,6 @@ def FISTA(self, _data_, _algorithm_, _regularisation_): res[:,ang_index,:] = res[:,ang_index,:] + _data_['ringGH_accelerate']*r_x vec = res.sum(axis = 1) r = r_x - np.multiply(L_const_inv,vec) - if ((_data_['ring_weights_threshold'] is not None) and (iter_no > 0)): - # Approach for a better ring model - rings_weights = RING_WEIGHTS(np.float32(res), _data_['ring_tuple_halfsizes'][0], _data_['ring_tuple_halfsizes'][1], _data_['ring_tuple_halfsizes'][2]) - ring_function_weight = np.ones(np.shape(res)) - ring_function_weight[(np.where(np.abs(rings_weights) > _data_['ring_weights_threshold']))] = np.divide(_data_['ring_weights_threshold'], np.abs(rings_weights[(np.where(np.abs(rings_weights) > _data_['ring_weights_threshold']))])**_data_['ring_huber_power']) - res = np.multiply(ring_function_weight,res) if (self.datafidelity == 'SWLS'): res = self.Atools.forwproj(X_t) - _data_['projection_norm_data'] if (self.geom == '2D'): @@ -681,7 +657,7 @@ def ADMM_Atb(b): if (_algorithm_['nonnegativity'] == 'ENABLE'): X[X < 0.0] = 0.0 # z-update with relaxation - zold = z.copy(); + zold = z.copy() x_hat = _algorithm_['ADMM_relax_par']*X + (1.0 - _algorithm_['ADMM_relax_par'])*zold; if (self.geom == '2D'): x_prox_reg = (x_hat + u).reshape([self.ObjSize, self.ObjSize]) diff --git a/tomobar/supp/__init__.pyc b/tomobar/supp/__init__.pyc deleted file mode 100644 index 3b38194c438d6f6419229635791a9e7c24c5ac41..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 137 zcmZSn%*!?V<+tc$1}Ig`kf+;^{B!lS3AOaaM0yz#qT+9L_QW%06G#UL?G8BP?5yUSm{fzwFRQ<%9 z^!yxsm;B_?+|<01Vtp6aF#V8x-+U*>ApMg3-29}(BK_jhf&%^c_{_Y_lK6PNg34PQ UHo5sJr8%i~ATx`ZfCLKz0Dq$*j{pDw diff --git a/tomobar/supp/__pycache__/astraOP.cpython-310.pyc b/tomobar/supp/__pycache__/astraOP.cpython-310.pyc deleted file mode 100644 index ceb9c226626a5f3f4ee1b574d0e2a87c9d3e121a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14357 zcmeHOTaX;rS?s1W|EJZNm?&ttzW8rnYJBc_P5UMv1}_T_7w`)r z5KpUVp6(efy=H7%k}_-N$F#PsYy9&wp1G^*+6$VO@v^UIwXA1(IovJJ_VT#rynET4?(^P-r+4{NyJqbWo{xL)#`C-7c^c1-cR!x*_sb|hjOP>HNj#sF=NZpf z)+!IUAJ#Q(*;h?Ja5}3_qvZwxlHoNsbY4>K=4P|K=3HF9a`~bYb~>$<&dazvo4#7@ zs10XRb=Lhx*zB}tSKP++{$s&ydyeuOopunaEvdog@o%m=J70A+UFEh~e#=?$-3`Zc zL-%Z<@Z{1nH|L#Jv*EV`-+Av)ua&|DcPqTsQ4c#+x7}>EoR7HMZaWP8n-4qJ!f-Qq zcy@NJ8D863Ios%L%zD>Z+$dbS=C;@TR%h+uf`jYa2hX1Sz}dMu=Zv%Au6LBPxVVII zax!knsbYi}Sh^0JhUBV#ozf1T9=RiVjPsh*bYPWee zc`s^fMv_j-){Hgdw!WkIpt$Y^gySyw6dR%A9hL1d!)eLc#C*Zk1k*AxZdjfZBh zbvFE2x3$)3%~m^&tqmV*I$M4G>g<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