Skip to content
cnpemPublic

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

5 watching

Forks

Repository files navigation

SSC-CDI: Coherent Diffractive Imaging package

The package ssc-cdi is a collection of coherent diffractive imaging (CDI) tools developed by the Sirius Scientific Computing (SSC) Group at the Brazilian Center for Research in Energy and Materials (CNPEM). It currently provides high-performance implementations for Ptychography reconstructions. Additional algorithms and research prototypes are continuously incorporated into the project as they mature and undergo validation by the SSC Group.

The source code is publicly archived on Zenodo under DOI 10.5281/zenodo.13693177.

Example scripts are included to help users get started with the package.

💡 For questions, bug reports, or feature requests, contact the Sirius Scientific Computing Team at gcc@lnls.br.

Authors and Contributors

Authors

  • Eduardo X. Miqueles (CNPEM, ORCID)
  • Yuri Rossi Tonin (ORCID)
  • Giovanni L. Baraldi

Contributors

  • Leonardo M. Corrêa (CNPEM, ORCID)
  • Lucas Antonio Pelike (CNPEM)
  • Paola Ferraz (CNPEM, ORCID)
  • Matthew R. C. Fitzpatrick (CNPEM, ORCID)

Past Contributors

  • Mauro Luiz Brandão-Junior (CNPEM, ORCID)
  • Alan Zanoni Peixinho (ORCID)
  • Camila F. A. Lages (ORCID)
  • Julia C. Carvalho

Acknowledgements

We would like to acknowledge the Brazilian Ministry of Science, Technology, and Innovation MCTI for supporting this work through the Brazilian Center for Research in Energy and Materials (CNPEM).

Publications

The development of ssc-cdi has resulted in the following publications:

  1. Tonin, Y. R., Peixinho, A. Z., Brandão-Junior, M. L., Ferraz, P., and Miqueles, E. X. (2024). ssc-cdi: A Memory-Efficient, Multi-GPU Package for Ptychography with Extreme Data. Journal of Imaging, 10(11), 286. DOI: https://doi.org/10.3390/jimaging10110286.

  2. Baraldi, G. L., Dias, C. S., Silva, F. M., Tolentino, H. C., and Miqueles, E. X. (2020). Fast reconstruction tools for ptychography at Sirius, the fourth-generation Brazilian synchrotron. Journal of Applied Crystallography, 53(6), 1550–1558. DOI: https://doi.org/10.1107/S1600576720013886.

Citation

If you use ssc-cdi in published work, please cite:

@Article{jimaging10110286,
  author  = {Tonin, Yuri Rossi and Peixinho, Alan Zanoni and Brandao-Junior, Mauro Luiz and Ferraz, Paola and Miqueles, Eduardo Xavier},
  title   = {ssc-cdi: A Memory-Efficient, Multi-GPU Package for Ptychography with Extreme Data},
  journal = {Journal of Imaging},
  year    = {2024},
  volume  = {10},
  number  = {11},
  pages   = {286},
  doi     = {10.3390/jimaging10110286}
}

Documentation

The HTML documentation is available in:

docs/build/html/index.html

Open this file in your preferred web browser after building the documentation.

To build the documentation from source:

pip install -r docs/requirements.txt

cd docs
make html

The generated documentation will be available in:

docs/build/html/

Installation

The ssc-cdi package can be installed from source code or directly via pip (within the CNPEM network).

It requires C, C++, CUDA, Python, and CuPy to be installed before installation. The CuPy package is required to use the Maximum-Likelihood (ML) reconstruction engine. See the Requirements section for details.

The ssc-cdi package is imported as sscCdi in Python

import sscCdi

Install from Pip

⚠️ CNPEM Network Required

This installation method is available only within the CNPEM network.

❗ Tepui Cluster Users

Before installing sscCdi, load the required modules: cuda/11.2.2, python/3.11.11 and gcc/9.5.0-jld3zdv.

Install the latest available version:

pip install sscCdi \
    --index-url https://gitlab.cnpem.br/api/v4/projects/1875/packages/pypi/simple

Install a specific version:

pip install sscCdi==0.14.2 \
    --index-url https://gitlab.cnpem.br/api/v4/projects/1875/packages/pypi/simple

Replace 0.14.2 with the desired version number.

Install from GitLab

⚠️ CNPEM Network Required

This installation method is available only within the CNPEM network.

❗ Tepui Cluster Users

Before installing sscCdi, load the required modules: cuda/11.2.2, python/3.11.11 and gcc/9.5.0-jld3zdv.

Clone the repository and install the latest version:

git clone https://gitlab.cnpem.br/sirius/proc-sim-apps/sci/imaging/ssc-cdi.git
cd ssc-cdi
make clean && make

Install a specific version:

git clone https://gitlab.cnpem.br/sirius/proc-sim-apps/sci/imaging/ssc-cdi.git \
    --branch v<version> --single-branch

cd ssc-cdi
make clean && make

For example:

git clone https://gitlab.cnpem.br/sirius/proc-sim-apps/sci/imaging/ssc-cdi.git \
    --branch v0.14.2 --single-branch

cd ssc-cdi
make clean && make

Install from GitHub

Clone the public GitHub repository and install the latest version:

git clone https://github.com/cnpem/ssc-cdi.git
cd ssc-cdi
make clean && make

Install a specific version:

git clone https://github.com/cnpem/ssc-cdi.git \
    --branch v<version> --single-branch

cd ssc-cdi
make clean && make

For example:

git clone https://github.com/cnpem/ssc-cdi.git \
    --branch v0.14.2 --single-branch

cd ssc-cdi
make clean && make

Install from Zenodo Source Code

Source code releases are archived on Zenodo: https://doi.org/10.5281/zenodo.13693177

Download the desired version of ssc-cdi.tar.gz and extract it:

tar -xvf ssc-cdi.tar.gz

Enter the extracted directory and build the package:

cd ssc-cdi
make clean && make

Requirements

Before installing sscCdi, ensure that the following dependencies are available:

Dependency Minimum Version
CUDA >= 11.0
GCC / C++ Compiler >= 9.0
Python >= 3.8
CMake >= 3.24
CuPy Compatible with installed CUDA
libcurl4-openssl-dev -
cuBLAS -
cuFFT -
pthreads -
pip -

The installed CuPy package must match the CUDA version available on the system. For example:

CUDA Version CuPy Package
CUDA 11.x cupy-cuda11x
CUDA 12.x cupy-cuda12x

sscCdi supports NVIDIA GPUs with compute capability 7.0 or higher and requires a compiler with C++17 support.

Python Dependencies

The following Python packages are installed automatically:

  • scikit-build >= 0.17
  • setuptools >= 61.0
  • ninja == 1.11.1.1
  • wheel >= 0.45.0
  • numpy
  • scikit-image >= 0.19.3
  • scipy
  • matplotlib
  • SharedArray
  • h5py
  • ipywidgets
  • tqdm

Uninstall

To uninstall sscCdi, regardless of the installation method used:

pip uninstall sscCdi

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages