cdiutils
A python package to help Coherent Diffraction Imaging (CDI) practitioners in their analysis.
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.5%) to scientific vocabulary
Repository
A python package to help Coherent Diffraction Imaging (CDI) practitioners in their analysis.
Basic Info
Statistics
- Stars: 14
- Watchers: 6
- Forks: 10
- Open Issues: 31
- Releases: 3
Metadata Files
README.md
CDIutils
CDIutils is a Python package to help X-ray Bragg Coherent Diffraction Imaging (BCDI) practitioners in their analysis and visualisation workflows. I developed the package during my PhD.
The package is designed to handle the three primary stages of a BCDI data processing workflow:
- Pre-processing (data centering and cropping)
- Phase retrieval: utilises PyNX for accurate phasing (refer to PyNX documentation).
- Post-processing (orthogonalisation, phase manipulation, strain computation etc.)
It is assumed that the phase retrieval is conducted using the PyNX package. The BcdiPipeline class runs all three stages and can manage connections to different machines, especially for GPU-based phase retrieval.
Some features of this package include:
- Flexibility in Hardware: While the phase retrieval stage may leverage GPUs, pre- and post-processing can be executed without GPU support.
- Utility Functions: The package provides utility functions to analyse processed data and generate plots suitable for potential publications.
For a visual wrap-up, see the associated poster presented at XTOP24:

Documentation
Read the full documentation on Read the Docs
The documentation includes: - Tutorials: Step-by-step guides for common workflows - API Reference: Complete function and class documentation - Examples: Jupyter notebook examples - Installation Guide: Detailed setup instructions
Installation
Using pip (from PyPI - simplest way)
Install directly from PyPI:
bash
pip install cdiutils
Using conda (recommended for dependency management)
Option 1: Create a new conda environment with all dependencies
```bash
create conda environment directly from GitHub
conda env create -f https://raw.githubusercontent.com/clatlan/cdiutils/master/environment.yml
activate the environment
conda activate cdiutils-env
install cdiutils from PyPI
pip install cdiutils ```
Option 2: Install dependencies in your existing conda environment
```bash
download and install dependencies using conda solver
conda env update -f https://raw.githubusercontent.com/clatlan/cdiutils/master/environment.yml
install cdiutils from PyPI
pip install cdiutils ```
For development (includes documentation and testing tools):
```bash
create development environment directly from GitHub
conda env create -f https://raw.githubusercontent.com/clatlan/cdiutils/master/environment-dev.yml
activate the environment
conda activate cdiutils-dev-env
install cdiutils in development mode (requires cloning)
git clone https://github.com/clatlan/cdiutils.git cd cdiutils pip install -e . ```
Directly from GitHub (development version)
You can also install the latest development version directly from GitHub:
You can install the package directly from GitHub:
bash
pip install git+https://github.com/clatlan/cdiutils.git
To update your environment with the latest commits:
bash
pip install -I --no-deps git+https://github.com/clatlan/cdiutils.git
Note: Check out the dev branch for the latest features and bug fixes. The dev branch is not guaranteed to be stable.
Getting started
Once the package is installed, you can try it right away using the notebook template directly accessible with the command:
bash
prepare_bcdi_notebooks
This will generate a notebook templates in your current directory.
Processing BCDI data
Once data are processed, the BcdiPipeline instance saves the data in .npz, .cxi and .vti files following the CXI file format convention (see https://www.cxidb.org/cxi.html). It also plots summary and debug figures such as:
- Summary Slice Plot

- Isosurface determination

- Different strain computation methods

BCDI reconstruction analysis
If want to analyse and compare your reconstructions, check out the example notebook bcdireconstructionanalysis.ipynb in the examples folder. This notebook provides a comprehensive overview of the analysis process, including:
* Slice plots of any quantity you like (here phase) across different conditions:

Reciprocal space plots in the orthogonal frame (lab frame)

Histogram plots of any quantity you like across different conditions:

Cross section quiver
The cross section quiver is nice tool for visualising the strain and displacement fields and their relationship in BCDI data.
- The cross section quiver allows to plot cross section of strain and displacement field on the same plot.

- For different conditions

Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
If you encounter any issues or have questions:
- Check the documentation for tutorials and API reference
- Open an issue on the GitHub repository
- Browse existing issues to see if your question has been answered
Owner
- Name: Clément Atlan
- Login: clatlan
- Kind: user
- Repositories: 3
- Profile: https://github.com/clatlan
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this package for scientific work, please consider including a citation as below."
type: software
authors:
- family-names: Atlan
given-names: Clement
orcid: https://orcid.org/0000-0001-8531-7864
doi: 10.5281/zenodo.7656853
version: 0.2.0
date-released: 2025-02
title: "Cdiutils: A python package for Bragg Coherent Diffraction Imaging processing, analysis and visualisation workflows"
abstract: "A python package to help Bragg Coherent Diffraction Imaging (BCDI) practitioners in their analysis and visualisation workflows.
The package is designed to handle the three primary stages of a BCDI data processing workflow:
* **Proprocessing** (data centering and cropping)
* **Phase retrieval**: utilises PyNX for phasing (refer to [PyNX documentation](http://ftp.esrf.fr/pub/scisoft/PyNX/doc/)).
* **Post processing** (orthogonalisation, phase manipulation, strain computation etc.)
It is assumed that the phase retrieval is conducted using the PyNX package. The `BcdiPipeline` class runs all three stages and can manage connections to different machines, especially for GPU-based phase retrieval."
repository-code: https://github.com/clatlan/cdiutils
url: https://github.com/clatlan/cdiutils
license: MIT
GitHub Events
Total
- Fork event: 3
- Create event: 7
- Commit comment event: 1
- Release event: 1
- Issues event: 15
- Watch event: 3
- Delete event: 5
- Member event: 1
- Issue comment event: 19
- Push event: 142
- Pull request review comment event: 8
- Pull request review event: 13
- Pull request event: 23
Last Year
- Fork event: 3
- Create event: 7
- Commit comment event: 1
- Release event: 1
- Issues event: 15
- Watch event: 3
- Delete event: 5
- Member event: 1
- Issue comment event: 19
- Push event: 142
- Pull request review comment event: 8
- Pull request review event: 13
- Pull request event: 23
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 7
- Total pull requests: 14
- Average time to close issues: 9 months
- Average time to close pull requests: 23 days
- Total issue authors: 4
- Total pull request authors: 3
- Average comments per issue: 1.14
- Average comments per pull request: 0.0
- Merged pull requests: 8
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 3
- Pull requests: 13
- Average time to close issues: N/A
- Average time to close pull requests: about 17 hours
- Issue authors: 2
- Pull request authors: 3
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 7
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- clatlan (12)
- Abd-zak (6)
- ewbellec (4)
- kyolson (3)
- mirichard-S (2)
- DSimonne (2)
- sjleake (1)
- Manalorca (1)
- ccechatelier (1)
Pull Request Authors
- clatlan (17)
- DSimonne (12)
- Manalorca (1)
- Abd-zak (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
- Total maintainers: 1
pypi.org: cdiutils
A Python package for (Bragg) Coherent X-ray Diffraction Imaging processing, analysis and visualisation workflows.
- Homepage: https://github.com/clatlan/cdiutils
- Documentation: https://cdiutils.readthedocs.io/
- License: mit
-
Latest release: 0.2.0
published 7 months ago
Rankings
Maintainers (1)
Dependencies
- PyYAML >=6.0
- colorcet >=3.0.0
- h5py >=3.6.0
- hdf5plugin >=3.2.0
- matplotlib >=3.5.2
- numpy >=1.22.3
- pandas >=1.4.2
- paramiko >=2.12.0
- ruamel.yaml >=0.17.21
- ruamel.yaml.clib >=0.2.7
- scikit-image >=0.19.2
- scikit-learn >=1.1.3
- scipy >=1.8.0
- seaborn >=0.12.1
- silx >=1.0.0
- sklearn >=0.0.post1
- vtk ==9.1.0
- xrayutilities >=1.7.3
- PyYAML >=6.0
- bcdi *
- colorcet >=3.0.0
- h5py >=3.6.0
- hdf5plugin >=3.2.0
- matplotlib >=3.5.2
- numpy >=1.22.3
- pandas >=1.4.2
- paramiko >=2.12.0
- ruamel.yaml >=0.17.21
- ruamel.yaml.clib >=0.2.7
- scikit-image >=0.19.2
- scikit-learn >=1.1.3
- scipy >=1.8.0
- seaborn >=0.12.1
- silx >=1.0.0
- sklearn >=0.0.post1
- vtk ==9.1.0
- xrayutilities >=1.7.3