Skip to main content

docs gitter github precommit pypi

LiberTEM-holo

LiberTEM-holo is an open source Python library for holography reconstruction using LiberTEM. Electron Holograms are captured by interfering two parts of a coherent electron beam passing through (1) vacuum and (2) a sample. An electron biprism is used to interfere the two parts of this electron beam. The interference pattern is recorded, and the complex waveform can be reconstructed from it using this software. From the phase of the complex waveform one can then for example determine the magnetic signal from the sample.

More information can be found on Wikipedia or the Handbook of Microscopy.

Goals

  • Support good Open Science practices (open source, reproducibility, interoperability)

  • Fast workflows for a faster turn-around time; support full reconstruction on the GPU

  • Suitability for live- near-live reconstruction and integration into automated acquisition workflows

  • Platform for developments in this area (example: phase unwrapping implementations)

  • Full- or semi-automatic operation from hologram stack to phase image

  • Include analyses that follow reconstruction of the phase image

Workflow

This software focuses on the steps required to reconstruct the electron phase from stacks of electron holograms. In general, the steps required to reconstruct the electron holograms to phase images are:

  1. Complex image reconstruction from electron holograms - most parameters can be determined automatically. Two customizable filters - circle and line butterworths filters are available to select the side band and filter out the fresnel fringes in the image. The complex image can be calculated from the filtered fft.

  2. Stack alignment - if an image stack was acquired for improving the signal, the sample drift and biprism drift can be compensated. The sample drift is calculated using cross-correlation. The cross correlation is usually performed on the amplitude of the complex images, or a separate brightfield reconstruction of the holograms. The drift is applied on the complex stack. The biprism drift appears as a phase drift in the complex image. This phase drift is compensated using the angular synchronization method by Filbir et al.. After drift correction and phase compensation, the complex stacks are summed up to create a single complex image. The phase of this complex image is the phase difference induced by the sample - this signal could be due to electric or magnetic field (as per Aharonov Bohm effect).

  3. Phase image processing and visualization - phase unwrapping is performend and residual phase ramps can be removed at this stage. The phase and the contour can then be plotted.

Example jupyter notebooks are available in the GitHub repository.

The Alignement.ipynb and Reconstruction.ipynb notebooks are using GPU-accelerated reconstruction on a stack of holograms collected on a iron oxide nanoparticles, showing the different functionalities for reconstruction and alignment of phase images for MIP removal. The datasets are available on Zenodo Repository 21108532.

The UDF/stack-reconstruction.ipynb notebook is based on User Defined Function and using efficient CPU parallelization for large stack reconstruction. The holograms were acquired on a magnetic YIG lamella. The dataset is available on Zenodo Repository 15222400.

Installation

If you are using conda, for example via miniforge, installation into a new environment can be done as follows:

$ conda create -n holo python=3.12
$ conda activate holo
$ pip install libertem-holo

For GPU support, install the gpu extra, and cupy. For example

$ conda create -n holo python=3.12
$ conda activate holo
$ pip install libertem-holo[gpu] cupy-cuda13x 'cuda-toolkit[all]<14'

Make sure to pick a CUDA version that works with your GPU and its drivers. For more details, please check the CuPy installation guide.

For using the GUI components, install the gui extra:

$ pip install libertem-holo[gui]

Input File formats

LiberTEM-holo was designed specfically for working on larger stacks of images without loading them into memory. In addition to files created by Gatan Digital Micrograph (.dm3, .dm4), any file format supported by LiberTEM can be loaded.

License

LiberTEM-holo is licensed under GPLv3.

Metadata

Release files for libertem-holo 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for libertem-holo 1.0.0
File Size Uploaded
libertem_holo-1.0.0.tar.gz 12.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for libertem-holo 1.0.0
File Interpreter ABI Platform
libertem_holo-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.2 MB

Release files / libertem_holo-1.0.0.tar.gz

Download URL libertem_holo-1.0.0.tar.gz
Size 12.2 MB
Tags Source
SHA-256 checksum
How to use checksums
b0729f047106bfc47d03c562a04aacf9b252d3e819fd863133e31abe94507d0b
BLAKE2b-256 checksum
How to use checksums
da4fbdacf6a0bc862acfb1163ad0c2ca1468cb91be1c74d240523e8e89af1f26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / libertem_holo-1.0.0-py3-none-any.whl

Download URL libertem_holo-1.0.0-py3-none-any.whl
Size 57.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6bbb3bb41808c210a0a7e1bd8681ec4cf976c32cb37ed3aefbd143a8ee383032
BLAKE2b-256 checksum
How to use checksums
df345a382426f016b0d174ddad0a3ea837cd7278c418674e1b81e96b4bffec60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page