LiberTEM - Open Pixelated STEM platform
LiberTEM is an open source platform for high-throughput distributed processing of large-scale binary data sets and live data streams using a modified MapReduce programming model. The current focus is pixelated scanning transmission electron microscopy (STEM) [MacLaren et al. (2016), Ophus (2019)] and scanning electron beam diffraction data.
MapReduce-like processing allows to specify an algorithm through two functions: One function that is mapped on portions of the input data, and another function that merges (reduces) a partial result from this mapping step into the complete result. A wide range of TEM and 4D STEM processing tasks can be expressed in this fashion, see Applications.
The UDF interface of LiberTEM offers a standardized, versatile API to decouple the mathematical core of an algorithm from details of data source, parallelism, and use of results. Mapping and merging can be performed in any order and with different subdivisions of the input data, including running parts of the calculation concurrently. That means the same implementation can be used in a wide range of modalities, including massive scaling on clusters. Since each merge step produces an intermediate result, this style of processing is suitable for displaying live results from a running calculation in a GUI application and for processing live data streams. A closed-loop feedback between processing and instrument control can be realized as well. See User-defined functions for more details on the LiberTEM UDF interface.
The LiberTEM back-end offers high throughput and scalability on PCs, single server nodes, clusters and cloud services. On clusters it can use fast distributed local storage on high-performance SSDs. That way it achieves very high aggregate IO performance on a compact and cost-efficient system built from stock components. All CPU cores and CUDA devices in a system can be used in parallel.
LiberTEM is supported on Linux, Mac OS X and Windows. Other platforms that allow installation of Python 3.7+ and the required packages will likely work as well. The GUI is running in a web browser.
Installation
The short version:
$ virtualenv -p python3 ~/libertem-venv/
$ source ~/libertem-venv/bin/activate
(libertem-venv) $ python -m pip install "libertem[torch]"
# optional for GPU support
# See also https://docs.cupy.dev/en/stable/install.html
(libertem-venv) $ python -m pip install cupy
Please see our documentation for details!
Alternatively, to run the LiberTEM Docker image:
$ docker run -p localhost:9000:9000 --mount type=bind,source=/path/to/your/data/,dst=/data/,ro ghcr.io/libertem/libertem
or
$ singularity exec docker://ghcr.io/libertem/libertem /venv/bin/libertem-server
Deployment for offline data processing on a single-node system for a local user is thoroughly tested and can be considered stable. Deployment on a cluster is experimental and still requires some additional work, see Issue #105. Back-end support for live data processing is still experimental as well, see https://github.com/LiberTEM/LiberTEM-live.
Applications
Since LiberTEM is programmable through user-defined functions (UDFs), it can be used for a wide range of processing tasks on array-like data and data streams. The following applications have been implemented already:
Virtual detectors (virtual bright field, virtual HAADF, center of mass [Krajnak et al. (2016)], custom shapes via masks)
Some of these applications are available through an interactive web GUI. Please see the applications section of our documentation for details!
The Python API and user-defined functions (UDFs) can be used for complex operations such as arbitrary linear operations and other features like data export. Example Jupyter notebooks are available in the examples directory. If you are having trouble running the examples, please let us know by filing an issue or by joining our Gitter chat.
LiberTEM is suitable as a high-performance processing backend for other applications, including live data streams. Contact us if you are interested!
LiberTEM is evolving rapidly and prioritizes features following user demand and contributions. Currently we are working on live data processing, improving application support for sparse data and event-based detectors, performance improvements for GPU processing, and implementing analysis methods for various applications of pixelated STEM and other large-scale detector data. If you like to influence the direction this project is taking, or if you’d like to contribute, please join our gitter chat and our general mailing list.
File formats
LiberTEM currently opens most file formats used for pixelated STEM. See our general information on loading data and format-specific documentation for more information!
Raw binary files
NumPy .npy binary files
Thermo Fisher EMPAD detector [Tate et al. (2016)] files
Nanomegas .blo block files
Direct Electron DE5 files (HDF5-based) and Norpix SEQ files for DE-Series detectors
Gatan K2 IS raw format
Stacks of Gatan DM3 and DM4 files (via openNCEM)
Single-file Gatan DM4 scans when saved using C-ordering
FRMS6 from PNDetector pnCCD cameras [Simson et al. (2015)] (currently alpha, gain correction still needs UI changes)
FEI SER files (via openNCEM)
MRC (via openNCEM)
HDF5-based formats such as HyperSpy files, NeXus and EMD
TVIPS binary files
Sparse data in Raw CSR (compressed sparse row) format, as is possible to generate from event-based detectors
Please contact us if you are interested in support for an additional format!
Live processing and detectors (experimental)
See LiberTEM-live!
License
LiberTEM is licensed under the MIT license.
Acknowledgements
We are very grateful for your continuing support for LiberTEM!
See the acknowledgement page for a list of authors and contributors to LiberTEM and its subprojects. See also our info on funding and industry partners.
Documentation
- Installation
- GUI usage
- Applications
- Loading data
- Sample Datasets
- Python API
- User-defined functions (UDFs)
- Dask integration
- Changelog
- 0.15.0.dev0
- 0.14.1 / 2024-06-19
- 0.14.0 / 2024-05-16
- 0.13.1 / 2023-11-09
- 0.13.0 / 2023-11-09
- 0.12.0 / 2023-08-16
- 0.11.2 / 2023-07-04
- 0.11.1 / 2023-05-11
- 0.11.0 / 2023-04-21
- 0.10.0 / 2022-07-28
- 0.9.2 / 2022-04-28
- 0.9.0 / 2022-02-17
- 0.8.0 / 2021-10-04
- 0.7.1 / 2021-07-08
- 0.7.0 / 2021-06-10
- 0.6.0 / 2021-02-16
- 0.5.1 / 2020-08-12
- 0.5.0 / 2020-04-23
- 0.4.1 / 2020-02-18
- 0.4.0 / 2020-02-13
- 0.3.0 / 2019-12-12
- 0.2.2 / 2019-10-14
- 0.2.1 / 2019-10-07
- 0.2.0 / 2019-10-07
- 0.1.0 / 2018-11-06
- Citing
- Acknowledgments
- Python API reference
- Tips and tricks
- Using SSH forwarding
- Activating ipywidgets in Jupyter
- Running in a top-level script
- Gatan Digital Micrograph and other embedded interpreters
- Show deprecation warnings
- Profiling long-running tests
- Platform-dependent code and remote executor
- Benchmark Numba compilation time
- Simulating slow systems with control groups
- Jupyter
- JupyterHub
- Package overview
- Concepts
- Performance
- Why Python?
Indices and tables
Citations
J. M. Gibson and M. M. J. Treacy. Diminished medium-range order observed in annealed amorphous germanium. Physical Review Letters, 78(6):1074–1077, feb 1997. doi:10.1103/physrevlett.78.1074.
Giulio Guzzinati, Wannes Ghielens, Christoph Mahr, Armand Béché, Andreas Rosenauer, Toon Calders, and Jo Verbeeck. Electron bessel beam diffraction for precise and accurate nanoscale strain mapping. Applied Physics Letters, 2019. arXiv:1902.06979v3, doi:10.1063/1.5096245.
Giulio Guzzinati, Wannes Ghielens, Christoph Mahr, Armand Béché, Andreas Rosenauer, Toon Calders, and Jo Verbeeck. Electron Bessel beam diffraction patterns, line scan of Si/SiGe multilayer. February 2019. URL: https://doi.org/10.5281/zenodo.2566137, doi:10.5281/zenodo.2566137.
Colin Ophus and Benjamin Savitzky. Simulated calibration dataset for 4D scanning transmission electron microscopy. December 2019. URL: https://doi.org/10.5281/zenodo.3592520, doi:10.5281/zenodo.3592520.
Ouliana Panova, Colin Ophus, Christopher J. Takacs, Karen C. Bustillo, Luke Balhorn, Alberto Salleo, Nitash Balsara, and Andrew M. Minor. Diffraction imaging of nanocrystalline structures in organic semiconductor molecular thin films. Nature Materials, jun 2019. doi:10.1038/s41563-019-0387-3.
T. Pennycook. Graphene simulated dataset. January 2021. URL: https://doi.org/10.5281/zenodo.4476506, doi:10.5281/zenodo.4476506.
H. Rose. Nonstandard imaging methods in electron microscopy. Ultramicroscopy, 2:251–267, 1976. URL: https://www.sciencedirect.com/science/article/pii/S0304399176915382, doi:https://doi.org/10.1016/S0304-3991(76)91538-2.
Erich Schubert and Michael Gertz. Numerically stable parallel computation of (co-)variance. In Proceedings of the 30th International Conference on Scientific and Statistical Database Management - SSDBM 18. ACM Press, 2018. doi:10.1145/3221269.3223036.
Achim Strauch, Alexander Clausen, Dieter Weber, and Knut Müller-Caspary. High-resolution 4D STEM dataset of SrTiO3 along the [1 0 0] axis at high magnification. July 2021. Achim Strauch and Knut Müller-Caspary were supported by funding from the Initiative and Network Fund of the Helmholtz Association (Germany) under contract VH-NG-1317 (moreSTEM project). Knut Müller-Caspary acknowledges support from Helmholtz within the project "Ptychography 4.0" under contract ZT-I-0025. URL: https://doi.org/10.5281/zenodo.5113449, doi:10.5281/zenodo.5113449.
Achim Strauch, Dieter Weber, Alexander Clausen, and Knut Müller-Caspary. Synthetic 4D STEM dataset based on a SrTiO3 supercell with two additional artificial spatial frequencies. July 2021. Achim Strauch and Knut Müller-Caspary were supported by funding from the Initiative and Network Fund of the Helmholtz Association (Germany) under contract VH-NG-1317 (moreSTEM project). Knut Müller-Caspary acknowledges support from Helmholtz within the project "Ptychography 4.0" under contract ZT-I-0025. URL: https://doi.org/10.5281/zenodo.5113235, doi:10.5281/zenodo.5113235.
Steven E Zeltmann, Alexander Müller, Karen C Bustillo, Benjamin Savitzky, Lauren Hughes, Andrew M Minor, and Colin Ophus. Patterned probes for high precision 4D-STEM bragg measurements. Ultramicroscopy, 2019. arXiv:1907.05504v2, doi:10.1016/j.ultramic.2019.112890.
S. C. F. Lin, C. Y. Wong, G. Jiang, M. A. Rahman, and N. M. Kwok. Radial fourier analysis (RFA) image descriptor. In 2014 11th International Conference on Fuzzy Systems and Knowledge Discovery (FSKD), 814–819. Aug 2014. doi:10.1109/FSKD.2014.6980942.