My 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:
- Proprocessing (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. Users have the option to choose the present package (using the
cdiutils
backend) or the bcdi package (with thebcdi
backend). - Utility Functions: The package provides utility functions to analyze processed data and generate plots suitable for potential publications.
For visual wrap-up, see the associated poster presented at XTOP24:
You can install the package using the following command:
pip install git+https://github.com/clatlan/cdiutils.git
To update your environment with the latest commits:
pip install -I --no-deps git+https://github.com/clatlan/cdiutils.git
Upgrade your environment with a new version of the package:
pip install -U git+https://github.com/clatlan/cdiutils.git
Once the package is installed, you can try it right away using the notebook template directly accessible with the command:
prepare_bcdi_notebook.py [path_to_destination]
This will generate a notebook template at the given destination.
Once data are processed, the BcdiPipeline instance saves the data in .npz, .h5 .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
- Orthogonalization in the direct space
cdiutils.plot.slice.plot_3D_volume_slices function
- Bragg electron density slice plot
- Comparing contour of support
- Phase slice plot
cdiutils.plot.quiver.quiver_plot
- The cross section quiver allows to plot cross section of strain and displacement field on the same plot.
- For different conditions
- Can also be used to plot the curves/arrows only
- Can also be used to plot basic cross sections
cdiutils.plot.slice.plot_diffraction_patterns