Skip to content
forked from carnisj/bcdi

BCDI: tools for pre(post)-processing Bragg coherent X-ray diffraction imaging data

License

Notifications You must be signed in to change notification settings

X-rayScattering/bcdi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BCDI: tools for pre(post)-processing Bragg and forward coherent X-ray diffraction imaging data

Introduction

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 as a python toolkit

BCDI can be used as a python library with the following main modules:

  1. bcdi.algorithms: PSF and image deconvolution using Richardson-Lucy algorithm
  2. bcdi.facet_recognition: Stereographic projection of a diffraction peak or a reconstructed crystal. Automatic detection of reconstructed facets and statistics on facet strain.
  3. bcdi.experiment: definition of the experimental geometry (beamline, setup, detector...).
  4. bcdi.graph : generation of plots using predefined templates.
  5. bcdi.postprocessing: various methods for post-processing the complex output of a phasing algorithm.
  6. bcdi.preprocessing: various methods for pre-processing the diffraction intensity.
  7. 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.
  8. bcdi.utils: data loading, fitting functions ...

Acknowledgment and third party packages

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

Download & Installation

BCDI is available from:

Please send feedback in GitHub or at carnis_jerome@yahoo.fr

Changelog

See the full Changelog<changelog>

Citation & Bibliography

If you use BCDI for scientific work, please consider including a citation (DOI: 10.5281/zenodo.3257616).

License

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

Documentation

The documentation is available at: https://bcdi.readthedocs.io/en/latest/

BCDI.algorithms: psf and image deconvolution algorithms

Description

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.

BCDI.facet_recognition: automatic facet detection in BCDI 3D reconstructions

Description

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 ================================================================

Description

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

BCDI.preprocessing: preprocessing utilities on the diffraction data before phasing

Description

This module provides methods used for pre-processing phased data. For example (but not limited to): hotpixels removal, filtering, masking...

BCDI.postprocessing: postprocessing utilities on the complex object after phasing

Description

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...

BCDI.publication: utilities to make formatted figure for publication

Description

This module provides scripts with templates for figures that can be used in presentations.

BCDI.simulation: simulation of diffraction patterns

Description

This module provides methods used for the calculation of the diffraction intensity based on FFT or kinematical sum.

BCDI.graph: plotting utilities

Description

This module provides methods to plot 2D and 3D data using templates, and to save it as a .vti file.

BCDI.utils: various utilities for data analysis

Description

Various non-specific utilities (i/o, ...)

About

BCDI: tools for pre(post)-processing Bragg coherent X-ray diffraction imaging data

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%