Package: libertem
LiberTEM is an open source platform for high-throughput distributed processing
of large-scale binary data sets and live data streams using a modifiedMapReduce programming model. The
current focus ispixelatedscanning 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, seeApplications.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
forprocessing live data streams.
A closed-loop feedback between processing and instrument control can be realized
as well. SeeUser-defined functionsfor more details on the
LiberTEM UDF interface.The LiberTEM back-end offershigh throughput and scalabilityon PCs, single server
nodes, clusters and cloud services. On clusters it can use fast distributed
local storage on high-performance SSDs. That way it achievesvery high
aggregate IO performanceon 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.InstallationThe short version:$virtualenv-ppython3~/libertem-venv/$source~/libertem-venv/bin/activate(libertem-venv)$python-mpipinstall"libertem[torch]"# optional for GPU support
# See also https://docs.cupy.dev/en/stable/install.html(libertem-venv)$python-mpipinstallcupyPlease seeour documentationfor details!Alternatively, to run theLiberTEM Docker image:$dockerrun-plocalhost:9000:9000--mounttype=bind,source=/path/to/your/data/,dst=/data/,roghcr.io/libertem/libertemor$singularityexecdocker://ghcr.io/libertem/libertem/venv/bin/libertem-serverDeployment 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, seeIssue #105. Back-end support for live data processing
is still experimental as well, seehttps://github.com/LiberTEM/LiberTEM-live.ApplicationsSince LiberTEM is programmable throughuser-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 materialsStrain mappingOff-axis electron holography reconstructionSingle Side Band ptychographySome of these applications are available through aninteractive web GUI. Please seethe
applications sectionof 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 theexamples directory. If you are having
trouble running the examples, please let us know by filing an issue or
byjoining our Gitter chat.LiberTEM is suitable as a high-performance processing backend for other
applications, including live data streams.Contact usif you are interested!LiberTEM is evolving rapidly and prioritizes features following user demand and
contributions. Currently we are working onlive 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 tocontribute, please join ourgitter chatand ourgeneral mailing list.File formatsLiberTEM currently opens most file formats used for pixelated STEM. Seeour
general information on loading dataandformat-specific
documentationfor more
information!Raw binary filesNumPy .npy binary filesThermo Fisher EMPAD detector filesQuantum Detectors MIB formatNanomegas .blo block filesDirect Electron DE5 files (HDF5-based) and Norpix SEQ files forDE-SeriesdetectorsGatan K2 ISraw formatStacks of Gatan DM3 and DM4 files (viaopenNCEM)Single-file Gatan DM4 scans when saved using C-orderingFRMS6 from PNDetector pnCCD cameras (currently alpha, gain correction still needs UI changes)FEI SER files (viaopenNCEM)MRC (viaopenNCEM)HDF5-based formats such as HyperSpy files, NeXus and EMDTVIPS binary filesSparse data in Raw CSR (compressed sparse row) format, as is possible
to generate from event-based detectorsPlease contact us if you are interested in support for an additional format!Live processing and detectors (experimental)SeeLiberTEM-live!LicenseLiberTEM is licensed under GPLv3. The I/O parts are also available under the MIT
license, please see LICENSE files in the subdirectories for details.AcknowledgementsWe are very grateful for your continuing support for LiberTEM!Seethe acknowledgement pagefor a list of authors and
contributors to LiberTEM and its subprojects. See also our info onfundingandindustry partners.