Skip to main content

Open pixelated STEM framework

Project description

docs gitter azure github codeclimate precommit joss zenodo pypi condaforge

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 127.0.0.1:9000:9000 --mount type=bind,source=/path/to/your/data/,dst=/data/,ro ghcr.io/libertem/libertem

or

$ apptainer 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:

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libertem-0.15.2.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libertem-0.15.2-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file libertem-0.15.2.tar.gz.

File metadata

  • Download URL: libertem-0.15.2.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for libertem-0.15.2.tar.gz
Algorithm Hash digest
SHA256 ef3cc2460fa5f8bbf1b39a847bf1008ad9d2f65c89d17fcc7e859c9772c33f72
MD5 9ab21594ba389577205dd276e29c5240
BLAKE2b-256 b107fb26f66c705a527c4541f1073d36a9df6c859e3c12d8363ea2a1662ffe7f

See more details on using hashes here.

File details

Details for the file libertem-0.15.2-py3-none-any.whl.

File metadata

  • Download URL: libertem-0.15.2-py3-none-any.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.18

File hashes

Hashes for libertem-0.15.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ffa4e7cd733649432263625189640aa8e2bd68edc0832e97a7ee9437431325cc
MD5 1e36511b887ada54f705eedbe679a8a3
BLAKE2b-256 5a2ee063f8cd9b2c52455869eb39dbdfcedae6a29ec2ed61cbfb5d16a372fd6d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page