/CIL

A versatile python framework for tomographic imaging

Primary LanguagePythonApache License 2.0Apache-2.0

Master Development Anaconda binaries
Build Status Build Status conda version conda last release conda platforms conda dowloads

CIL - Core Imaging Library

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.

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.

Documentation

The documentation for CIL can be accessed here.

Installation

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

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/label/dev -c ccpi cil cil-astra ccpi-regulariser tigre tomophantom=1.4.10

where,

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

cil-astra will give you access to the CIL wrappers to the ASTRA toolbox projectors (GPLv3 license).

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

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

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.

Building 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 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

The user then needs to add the path to <install_directory>/lib where the library is installed to the environment variable PATH or LD_LIBRARY_PATH, depending on system

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>

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