Skip to content

Latest commit

 

History

History
144 lines (79 loc) · 8.05 KB

README.md

File metadata and controls

144 lines (79 loc) · 8.05 KB
Master Development Anaconda binaries
Build Status Build Status conda version conda last release conda platforms conda dowloads

CIL - Core Imaging Library

Binder

The Core Imaging Library (CIL) is an open-source Python framework for tomographic imaging with particular emphasis on reconstruction of challenging datasets. Conventional filtered backprojection reconstruction tends to be insufficient for highly noisy, incomplete, non-standard or multichannel data arising for example in dynamic, spectral and in situ tomography. CIL provides an extensive modular optimisation framework for prototyping reconstruction methods including sparsity and total variation regularisation, as well as tools for loading, preprocessing and visualising tomographic data.

Documentation

The documentation for CIL can be accessed here.

Installation of CIL

Binary installation of CIL can be done with conda. Install a new environment using:

conda create --name cil -c conda-forge -c intel -c ccpi cil=22.1.0

To install CIL and the additional packages and plugins needed to run the CIL demos install the environment with:

conda create --name cil -c conda-forge -c intel -c astra-toolbox -c ccpi cil=22.1.0 astra-toolbox tigre ccpi-regulariser tomophantom

where,

astra-toolbox will allow you to use CIL with the ASTRA toolbox projectors (GPLv3 license).

tigre will allow you to use CIL with the TIGRE toolbox projectors (BSD license).

ccpi-regulariser will give you access to the CCPi Regularisation Toolkit.

tomophantom Tomophantom will allow you to generate phantoms to use as test data.

cudatoolkit If you have GPU drivers compatible with more recent CUDA versions you can modify this package selector (installing tigre via conda requires 9.2).

Dependency

CIL's optimised FDK/FBP recon module requires:

  1. the Intel Integrated Performance Primitives Library (license) which can be installed via conda from the intel channel.
  2. TIGRE, which can be installed via conda from the ccpi channel.

Getting Started with CIL

CIL on binder

Binder

Jupyter Notebooks usage examples without any local installation are provided in Binder. Please click the launch binder icon above. For more information, go to CIL-Demos and https://mybinder.org.

CIL Videos

Building CIL from source code

Getting the code

In case of development it is useful to be able to build the software directly. You should clone this repository as

git clone --recurse-submodule git@github.com:TomographicImaging/CIL.git

The use of --recurse-submodule is necessary if the user wants the examples data to be fetched (they are needed by the unit tests). We have moved such data, previously hosted in this repo at Wrappers/Python/data to the CIL-data repository and linked it to this one as submodule. If the data is not available it can be fetched in an already cloned repository as

git submodule update --init

Build dependencies

To create a conda environment with all the dependencies for building CIL run the following bash script:

sh scripts/create_local_env_for_cil_development.sh -n NUMPY_VERSION -p PYTHON_VERSION -e ENVIRONMENT_NAME

Or with the CIL build and test dependencies:

sh scripts/create_local_env_for_cil_development_tests.sh -n NUMPY_VERSION -p PYTHON_VERSION -e ENVIRONMENT_NAME

And then install CIL in to this environment using CMake.

Alternatively, one can use the scripts/requirements-test.yml to create a conda environment with all the appropriate dependencies on any OS, using the following command:

conda env create -f scripts/requirements-test.yml

Build with CMake

CMake and a C++ compiler are required to build the source code. Let's suppose that the user is in the source directory, then the following commands should work:

mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=<install_directory>
cmake --build . --target install

If targeting an active conda environment then the <install_directory> can be set to ${CONDA_PREFIX}.

If not installing to a conda environment then the user will also need to set the locations of the IPP library and includes, and the path to CIL.

By default the location of the IPP library and includes is ${CMAKE_INSTALL_PREFIX}/lib and ${CMAKE_INSTALL_PREFIX}/include respectively. To pass the location of the IPP library and headers please pass the following parameters:

cmake .. -DCMAKE_INSTALL_PREFIX=<install_directory> -DIPP_LIBRARY=<path_to_ipp_library> -DIPP_INCLUDE=<path_to_ipp_includes>

The user will then need to add the path <install_directory>/lib to the environment variable PATH or LD_LIBRARY_PATH, depending on system OS.

References

[1] Jørgensen JS et al. 2021 Core Imaging Library Part I: a versatile python framework for tomographic imaging. Phil. Trans. R. Soc. A 20200192. Code. Pre-print

[2] Papoutsellis E et al. 2021 Core Imaging Library - Part II: multichannel reconstruction for dynamic and spectral tomography. Phil. Trans. R. Soc. A 20200193. Code. Pre-print