Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

docs gitter github precommit pypi

LiberTEM-holo

LiberTEM-holo is a Python project 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.

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 real part of the image and 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 - residual phase ramps can be removed at this stage and the phase and the contour can 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.

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.

Download files

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

Source Distribution

libertem_holo-1.0.0rc0.tar.gz (12.2 MB view details)

Uploaded Source

Built Distribution

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

libertem_holo-1.0.0rc0-py3-none-any.whl (57.6 kB view details)

Uploaded Python 3

File details

Details for the file libertem_holo-1.0.0rc0.tar.gz.

File metadata

  • Download URL: libertem_holo-1.0.0rc0.tar.gz
  • Upload date:
  • Size: 12.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for libertem_holo-1.0.0rc0.tar.gz
Algorithm Hash digest
SHA256 f577fec90a6806f941d2a7e3f9267cf9b077921d6247efb1ff15ae43b4d93824
MD5 44c851cd08109d0d68c64c925104a600
BLAKE2b-256 a11f1b6215c1a721f800f7aaba041097db30b92910d93bd22f546fabd477898b

See more details on using hashes here.

File details

Details for the file libertem_holo-1.0.0rc0-py3-none-any.whl.

File metadata

File hashes

Hashes for libertem_holo-1.0.0rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 99eb6d30b37a818a21b4543794595bda8f27b6767a2ca3a4e019cc7bb9d5ed14
MD5 eb9cfece6e3b03162c2f7c46fd11ef79
BLAKE2b-256 7cf9ba816ffac06dfd4ce2b256380269f60109a34514f85c9e7a65be7b158fad

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 Sentry Error logging StatusPage Status page