LiberTEM
LiberTEM is an open source platform for high-throughput distributed processing of large-scale binary data sets and live data streams using a stream-based programming model. The current focus is pixelated scanning transmission electron microscopy (4DSTEM) and scanning electron beam diffraction data.
Cite this software
Description
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) 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 libertem/libertem
or
$ singularity exec docker://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, custom shapes via masks)
- Analysis of amorphous materials
- Strain mapping
- Off-axis electron holography reconstruction
- Single Side Band ptychography
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 files
- Quantum Detectors MIB format
- 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 (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 GPLv3. The I/O parts are also available under the MIT license, please see LICENSE files in the subdirectories for details.
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.
- GPL-3.0
Participating organisations
Mentions
- 1.Author(s): Paolo Rosi, Alexander Clausen, Dieter Weber, Amir H. Tavabi, Stefano Frabboni, Peter Tiemeijer, Rafal E. Dunin-Borkowski, Enzo Rotunno, Vincenzo GrilloPublished in Microscopy and Microanalysis by Oxford University Press (OUP) in 2023, page: 408-41710.1017/s143192762201248x
- 2.Author(s): David Landers, Ian Clancy, Rafal E. Dunin-Borkowski, Dieter Weber, Andrew A. StewartPublished in Micron by Elsevier BV in 2023, page: 10345010.1016/j.micron.2023.103450
- 3.Author(s): Shahar Seifer, Michael ElbaumPublished in HardwareX by Elsevier BV in 2023, page: e0043110.1016/j.ohx.2023.e00431
- 4.Author(s): Colin OphusPublished in Annual Review of Materials Research by Annual Reviews in 2023, page: 105-14110.1146/annurev-matsci-080921-092646
- 5.Author(s): David Landers, Ian Clancy, Rafal E. Dunin-Borkowski, Dieter Weber, Andrew StewartPublished in Ultramicroscopy by Elsevier BV in 2023, page: 11373810.1016/j.ultramic.2023.113738
- 6.Author(s): Arya Bangun, Paul F Baumeister, Alexander Clausen, Dieter Weber, Rafal E Dunin-BorkowskiPublished in Microscopy and Microanalysis by Oxford University Press (OUP) in 2023, page: 994-100810.1093/micmic/ozad021
- 7.Author(s): Johannes Müller, Max Heyl, Thorsten Schultz, Kristiane Elsner, Marcel Schloz, Steffen Rühl, Hélène Seiler, Norbert Koch, Emil J. W. List-Kratochvil, Christoph T. KochPublished in physica status solidi (a) by Wiley in 202310.1002/pssa.202300148
- 8.Author(s): Robert Colby, Kazem Edmond, Daniella Mendez, Stuart SmithPublished in Microscopy and Microanalysis by Oxford University Press (OUP) in 2023, page: 274-27510.1093/micmic/ozad067.125
- 9.Author(s): Alexander Clausen, Dieter Weber, Elisabeth Mueller, Emiliya Poghosyan, Daniel Stroppa, Rafal Dunin-BurkowskiPublished in Microscopy and Microanalysis by Oxford University Press (OUP) in 2023, page: 293-29310.1093/micmic/ozad067.135
- 10.Author(s): Marc Botifoll, Ivan Pinto-Huguet, Jordi ArbiolPublished in Nanoscale Horizons by Royal Society of Chemistry (RSC) in 2022, page: 1427-147710.1039/d2nh00377e
- 11.Author(s): Joydeep Munshi, Alexander Rakowski, Benjamin H. Savitzky, Steven E. Zeltmann, Jim Ciston, Matthew Henderson, Shreyas Cholia, Andrew M. Minor, Maria K. Y. Chan, Colin OphusPublished in npj Computational Materials by Springer Science and Business Media LLC in 202210.1038/s41524-022-00939-9
- 12.Author(s): Niels Cautaerts, Phillip Crout, Håkon W. Ånes, Eric Prestat, Jiwon Jeong, Gerhard Dehm, Christian H. LiebscherPublished in Ultramicroscopy by Elsevier BV in 2022, page: 11351710.1016/j.ultramic.2022.113517
- 13.Author(s): J Paul van Schayck, Yue Zhang, Kèvin Knoops, Peter J Peters, Raimond B G RavelliPublished in Microscopy and Microanalysis by Oxford University Press (OUP) in 2022, page: 352-36310.1093/micmic/ozac009
- 14.Author(s): Debangshu Mukherjee, Kevin M Roccapriore, Anees Al-Najjar, Ayana Ghosh, Jacob D Hinkle, Andrew R Lupini, Rama K Vasudevan, Sergei V Kalinin, Olga S Ovchinnikova, Maxim A Ziatdinov, Nageswara S RaoPublished in Microscopy Today by Oxford University Press (OUP) in 2022, page: 10-1910.1017/s1551929522001286
- 15.Author(s): D. Jannis, C. Hofer, C. Gao, X. Xie, A. Béché, T.J. Pennycook, J. VerbeeckPublished in Ultramicroscopy by Elsevier BV in 2022, page: 11342310.1016/j.ultramic.2021.113423
- 16.Author(s): Maxim Ziatdinov, Ayana Ghosh, Chun Yin Wong, Sergei V. KalininPublished in Nature Machine Intelligence by Springer Science and Business Media LLC in 2022, page: 1101-111210.1038/s42256-022-00555-8
- 17.Author(s): Sergei V. Kalinin, Colin Ophus, Paul M. Voyles, Rolf Erni, Demie Kepaptsoglou, Vincenzo Grillo, Andrew R. Lupini, Mark P. Oxley, Eric Schwenker, Maria K. Y. Chan, Joanne Etheridge, Xiang Li, Grace G. D. Han, Maxim Ziatdinov, Naoya Shibata, Stephen J. PennycookPublished in Nature Reviews Methods Primers by Springer Science and Business Media LLC in 202210.1038/s43586-022-00095-w
- 18.Author(s): Jiwon Jeong, Niels Cautaerts, Gerhard Dehm, Christian H. LiebscherPublished in Microscopy and Microanalysis by Oxford University Press (OUP) in 2021, page: 1102-111210.1017/s1431927621012538
- 19.Author(s): Achim Strauch, Dieter Weber, Alexander Clausen, Anastasiia Lesnichaia, Arya Bangun, Benjamin März, Feng Jiao Lyu, Qing Chen, Andreas Rosenauer, Rafal Dunin-Borkowski, Knut Müller-CasparyPublished in Microscopy and Microanalysis by Oxford University Press (OUP) in 2021, page: 1078-109210.1017/s1431927621012423
- 20.Author(s): Benjamin H. Savitzky, Steven E. Zeltmann, Lauren A. Hughes, Hamish G. Brown, Shiteng Zhao, Philipp M. Pelz, Thomas C. Pekin, Edward S. Barnard, Jennifer Donohue, Luis Rangel DaCosta, Ellis Kennedy, Yujun Xie, Matthew T. Janish, Matthew M. Schneider, Patrick Herring, Chirranjeevi Gopal, Abraham Anapolsky, Rohan Dhall, Karen C. Bustillo, Peter Ercius, Mary C. Scott, Jim Ciston, Andrew M. Minor, Colin OphusPublished in Microscopy and Microanalysis by Oxford University Press (OUP) in 2021, page: 712-74310.1017/s1431927621000477
- 21.Author(s): Brian Gorman, Megan Holtz, Christopher J. K. Richardson, Chomani Gaspe, Edwin Supple, Robert ButeraPublished in Microscopy and Microanalysis by Oxford University Press (OUP) in 2021, page: 184-18610.1017/s1431927621001276
- 22.Author(s): Gary W. Paterson, Robert W. H. Webster, Andrew Ross, Kirsty A. Paton, Thomas A. Macgregor, Damien McGrouther, Ian MacLaren, Magnus NordPublished in Microscopy and Microanalysis by Oxford University Press (OUP) in 2020, page: 944-96310.1017/s1431927620024307
- 23.Author(s): Magnus Nord, Robert W. H. Webster, Kirsty A. Paton, Stephen McVitie, Damien McGrouther, Ian MacLaren, Gary W. PatersonPublished in Microscopy and Microanalysis by Oxford University Press (OUP) in 2020, page: 653-66610.1017/s1431927620001713
- 24.Author(s): Alexander Clausen, Dieter Weber, Karina Ruzaeva, Vadim Migunov, Anand Baburajan, Abijith Bahuleyan, Jan Caron, Rahul Chandra, Sayandip Halder, Magnus Nord, Knut Müller-Caspary, Rafal Dunin-BorkowskiPublished in Journal of Open Source Software by The Open Journal in 2020, page: 200610.21105/joss.02006