BCDI stands for Bragg coherent X-ray diffraction imaging. It can be used for:
- pre-processing BCDI and forward CDI data (masking aliens, detector gaps...) before phasing
- post-processing phased data (phase offset and phase ramp removal, averaging, apodization, ...)
- data analysis on diffraction data (stereographic projection)
- data analysis on phased data (resolution calculation, statistics on the retrieved strain...)
- simulation of diffraction intensity (including noise, detector gaps, displacement fields...)
- creating figures for publication using templates
BCDI can be used as a python library with the following main modules:
bcdi.algorithms
: PSF and image deconvolution using Richardson-Lucy algorithmbcdi.facet_recognition
: Stereographic projection of a diffraction peak or a reconstructed crystal. Automatic detection of reconstructed facets and statistics on facet strain.bcdi.experiment
: definition of the experimental geometry (beamline, setup, detector...).bcdi.graph
: generation of plots using predefined templates.bcdi.postprocessing
: various methods for post-processing the complex output of a phasing algorithm.bcdi.preprocessing
: various methods for pre-processing the diffraction intensity.bcdi.simulation
: in BCDI geometry, calculation of the diffraction intensity based on FFT or kinematical sum. It can include a displacement field, noise, detector gaps etc... In forward CDI geometry, calculation of the Bragg pek positions in 3D for a mesocrystal, knowing the unit cell and unit cell parameter.bcdi.utils
: data loading, fitting functions ...
We would like to acknowledge the following packages:
- xrayutilities: (c) Dominik Kriegner, Eugen Wintersberger. See: J. Appl. Cryst. 46, 1162-1170 (2013).
- nxsReady: (c) Andrea Resta @ SOLEIL SIXS
- image_registration.py: original code from Xianhui Xiao @ APS Sector 2. See: Opt. Lett. 33, 156-158 (2008).
- Some functions were adapted from PyNX: (c) Vincent Favre-Nicolin. See: http://ftp.esrf.fr/pub/scisoft/PyNX/ and J. Appl. Cryst. 49, 1842-1848 (2016).
The following third-party packages are required:
- numpy
- scipy
- scikit-image
- matplotlib
- mayavi
- vtk
- h5py
- hdf5plugin
- fabio
- silx
- xrayutilities
- lmfit: for scripts performing fits
- pytables: when loading the dictionnary for SIXS data
- imagemagick (https://imagemagick.org) or ffmpeg (http://ffmpeg.zeranoe.com/builds/) for creating movies
- BCDI is available from:
- Python Package Index: pip install bcdi
- https://github.com/carnisj for the most updated version
- upgrade existing version from GitHub: pip install --upgrade git+https://github.com/carnisj/bcdi.git
Please send feedback in GitHub or at carnis_jerome@yahoo.fr
See the full Changelog<changelog>
If you use BCDI for scientific work, please consider including a citation (DOI: 10.5281/zenodo.3257616).
The BCDI library is distributed with a CeCILL-B license (an open-source license similar to the FreeBSD one). See http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
The documentation is available at: https://bcdi.readthedocs.io/en/latest/
This module includes routines using Richardson-Lucy deconvolution algorithm. In the future, algorithms used in phase retrieval (HIO, RAAR, ER, DM, ML...) will also be implemented.
This module provides tools for plotting the stereographic projection of a diffraction peak or an object. There is also a script for facet detection on a reconstructed object, and for calculating statistics on facet strain. After meshing the object, facets are found using a density estimation of mesh triangles normals, followed by watershed segmentation.
BCDI.experiment: class and methods defining the experimental setup ================================================================
This module provides a class and methods for the definition of the experimental setup. The geometry of the following beamlines is implemented:
- ID01 (ESRF)
- P10 (PETRAIII)
- 34ID-C (APS): only for postprocessing
- CRISTAL (SOLEIL)
- SIXS (SOLEIL)
The following detectors are implemented:
- Maxipix
- Eiger2M
- Eiger4M
This module provides methods used for pre-processing phased data. For example (but not limited to): hotpixels removal, filtering, masking...
This module provides methods used for post-processing phased data. For example (but not limited to): phase offset and ramp removal, centering, cropping, padding, aligning reconstructions, filtering...
This module provides scripts with templates for figures that can be used in presentations.
This module provides methods used for the calculation of the diffraction intensity based on FFT or kinematical sum.
This module provides methods to plot 2D and 3D data using templates, and to save it as a .vti file.
Various non-specific utilities (i/o, ...)