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.

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.0.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.0-py3-none-any.whl (57.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: libertem_holo-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 b0729f047106bfc47d03c562a04aacf9b252d3e819fd863133e31abe94507d0b
MD5 61b4db056fe56f72ca23be9b53ff1d7d
BLAKE2b-256 da4fbdacf6a0bc862acfb1163ad0c2ca1468cb91be1c74d240523e8e89af1f26

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libertem_holo-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 57.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for libertem_holo-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6bbb3bb41808c210a0a7e1bd8681ec4cf976c32cb37ed3aefbd143a8ee383032
MD5 dc71b068d6195c1a5f953450b3dcae66
BLAKE2b-256 df345a382426f016b0d174ddad0a3ea837cd7278c418674e1b81e96b4bffec60

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