Skip to content

LiberTEM/LiberTEM-holo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

330 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Electron holography reconstruction and preprocessing routines

Topics

Resources

License

Stars

5 stars

Watchers

3 watching

Forks

Packages

 
 
 

Contributors