dyadkin a93abf4177
ci linux-qt5 / build-test (push) Successful in 55s
ci linux-qt6 / build-test (push) Successful in 49s
ci macos / build-test (push) Successful in 1m5s
ci win / build-test (push) Successful in 1m21s
Crysalis: Write kappa0, beta and alpha to par
2026-10-29 21:17:59 +01:00
2022-10-15 22:03:44 +02:00
2026-07-03 15:32:59 +02:00
2026-08-14 12:34:42 +02:00

cryio

cryio is a C++ library for reading, writing and manipulating diffraction detector frames used at synchrotron beamlines. It is part of the Pylatus meta-package and is used by Pylatus, crymon and other components of the SNBL software stack.

The library provides a common CryioFrame base class and a set of format-specific frame classes with a unified API for image data, headers and metadata. It also includes parsers for calibration files .poni and .par, beam center handling and Crysalis run file generation.

Supported formats

Frame readers/writers implemented in cryio/cryio:

  • CBF / CBF header - cryio/cbfframe.h - Compressed Binary File, Dectris Pilatus/Eiger/Jungfrau - extensions: .cbf
  • EDF - cryio/edfframe.h - extensions: .edf, .azim
  • MAR345 / MAR - cryio/marframe.h + cryio/mar345.h/c - extensions: .mar2300, .mar3450, .mar2560
  • Bruker Gfrm - cryio/brukerframe.h - extensions: .gfrm
  • TIFF - cryio/tifframe.h - extensions: .tif, .tiff
  • Esperanto - cryio/esperantoframe.h - extensions: .esp, .esperanto
  • OXD - cryio/oxdframe.h - extensions: .img
  • Raxis STL - cryio/raxis.h - extensions: .stl
  • Fit2D mask - cryio/fit2dmaskframe.h - extensions: .msk
  • HDF5 based:
    • Eiger - cryio/eigerframe.h - extensions: .h5, .hdf5
    • Jungfrau - cryio/jungfrauframe.h - extensions: .h5, .hdf5
    • PyFAI - cryio/pyfaiframe.h - extensions: .h5, .hdf5
    • generic HDF5 - cryio/hdf5frame.h - extensions: .h5, .hdf5
  • Multi-frame - cryio/multiframe.h

Cryio::openFrame tries formats in the order CBF, EDF, MAR, Bruker, TIFF, Esperanto, OXD, Raxis, Fit2DMask, Jungfrau, Eiger, PyFAI.

Core components

  • cryio/cryioframe.h - base class CryioFrame derived from SiFrame<double>, from llr. Provides pixel size, exposure, angles omega/phi/kappa/theta, beam centre, wavelength, distance, header storage, endian conversion, smart append and multiframe navigation.
  • cryio/cryio.h - Cryio::open<T>, Cryio::openFrame, extension list helpers and Cryio::Pilatus dimension utilities.
  • cryio/crysalis.h - Crysalis run file creation, .par file generation and auxiliary files for Dectris detectors.
  • cryio/parparser.h - parser for .par calibration files.
  • cryio/poniparser.h - parser for PyFAI .poni files, with Nexus HDF5 support.
  • cryio/beamcenter.h - beam centre extraction from CBF headers.
  • cryio/detectors.h - detector id tables and default pixel sizes for Pilatus, Eiger, Frelon, Maxipix, Mythen, Quantum, Hf, IMxpad, Fairchild, Titan, Basler, Perkin, Pixium.

Templates for Crysalis settings in templates/.

Build

cryio uses CMake 3.27+, C++17.

Dependencies managed via cmake-tools:

  • Qt5/6 Core
  • llr - low level array and endian utilities
  • HDF5 1.14
  • bitshuffle 0.5.2, zstd
  • TIFF v4.7.1

CMake options:

  • NO_AVX - disable AVX/AVX2 code paths
  • CRYIO_BUILD_TESTS - build GoogleTest suite in tests/
  • CRYIO_BUILD_BENCHES - build benchmarks and conversion utilities

Typical build:

mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . -j

The library is built as a set of static targets: cryio_basic, cryio_multi, cryio_cbf, cryio_oxd, cryio_edf, cryio_mar, cryio_bruker, cryio_fit2dmask, cryio_esperanto, cryio_tiff, cryio_hdf5, cryio_eiger, cryio_jungfrau, cryio_pyfai, cryio_raxis, cryio_par, cryio_poni, cryio_beamcenter, cryio_frames.

Tests

tests/ contains GoogleTest based tests using test data downloaded via tests/tests.cmake. Tests cover CBF, EDF, MAR, Bruker, Fit2D mask, Eiger, PyFAI, TIFF, Esperanto, OXD, Raxis, Poni parser and save/load roundtrips.

Enable with -DCRYIO_BUILD_TESTS=ON.

Repository

Submodule of Pylatus meta-repo.

URL: https://git.3lp.cx/dyadkin/cryio

Parent: https://git.3lp.cx/dyadkin/pylatus

License

GPL-3.0+

S
Description
Crystallographic IO API
Readme
5.3 MiB
0 Stars 1 Watchers 0 Forks
Languages
C++ 74.5%
Jinja 12.9%
C 8.7%
CMake 3.9%