CDIutils Documentation#

CDIutils is a Python package for Bragg Coherent X-ray Diffraction Imaging (BCDI) data analysis.

Main Capabilities#

Complete BCDI pipeline

Handle pre-processing, phasing (PyNX backend), and post-processing to extract quantitative strain information. Jupyter notebooks provide step-by-step workflows:

Multiple beamline geometries

Support for ID01, P10, SIXS, NanoMAX, and ID27 beamlines. Coordinate transformations use CXI convention and xrayutilities backends.

Publication-ready figures

Utility functions for creating publication-quality plots. See bcdi_reconstruction_analysis.ipynb for examples.

Interactive 3D visualisation

Tools for exploring reconstruction results interactively. See Interactive Module for available classes.

CXI file management

CXIFile manager simplifies CXI file creation. CXIExplorer provides interactive inspection of CXI files

Quick Start#

Minimal working example:

import cdiutils

# define parameters
params = cdiutils.pipeline.get_params_from_variables(
    beamline_setup="id01",
    experiment_file_path="/path/to/data.h5",
    sample_name="MySample",
    scan=42
)

# create and run pipeline
pipeline = cdiutils.BcdiPipeline(params=params)
pipeline.preprocess(preprocess_shape=(200, 200, 200))
pipeline.phase_retrieval(nb_run=50)
pipeline.postprocess(voxel_size=5)
pipeline.show_3d_final_result()

See Quickstart: 5-Minute BCDI Analysis for details.

Getting Help#

Citation#

If you use CDIutils in your research, please cite:

@software{cdiutils,
  author = {Atlan, Clement and others},
  title = {CDIutils: A Python package for Bragg Coherent X-ray Diffraction Imaging},
  url = {https://github.com/clatlan/cdiutils},
  version = {0.2.0},
  year = {2024}
}

Indices and tables#