| Literature DB >> 36215263 |
Raul Castañeda1, Carlos Trujillo2, Ana Doblas1.
Abstract
pyDHM is an open-source Python library aimed at Digital Holographic Microscopy (DHM) applications. The pyDHM is a user-friendly library written in the robust programming language of Python that provides a set of numerical processing algorithms for reconstructing amplitude and phase images for a broad range of optical DHM configurations. The pyDHM implements phase-shifting approaches for in-line and slightly off-axis systems and enables phase compensation for telecentric and non-telecentric systems. In addition, pyDHM includes three propagation algorithms for numerical focusing complex amplitude distributions in DHM and digital holography (DH) setups. We have validated the library using numerical and experimental holograms.Entities:
Mesh:
Year: 2022 PMID: 36215263 PMCID: PMC9551626 DOI: 10.1371/journal.pone.0275818
Source DB: PubMed Journal: PLoS One ISSN: 1932-6203 Impact factor: 3.752
Fig 1Scheme of a transmission DHM.
(a) Optical setup based on a Mach-Zehnder interferometer in which the microscope objective (MO) lens and tube lens (TL) are generally arranged in non-telecentric mode (d ≠ fTL). (b)-(d) Classification of the DHM system based on the interference angle between the object and reference waves (in-line, slightly off-axis, and off-axis) based on the Fourier spectrum of the hologram. The size of the DC diffraction order (red circle) is always double the ±1 terms (blue circles) if the DHM system operates in the telecentric regime (d = fTL). The system components are: BS1 and BS2, beam-splitters; CL, converging lens; IP, image plane; M1 and M2 mirrors; O, object wavefront; R, reference wavefront.
Fig 2Spreading of the ±1 diffraction orders when the DHM system does not operate in telecentric regime.
Available functions in the utility package.
| Utility function | Specifications |
|---|---|
|
| imageRead(namefile) |
| Function to read an image. The parameter | |
|
| imageShow(inp, name) |
| Function to display an image. Two parameters are necessary: | |
|
| amplitude(output, log) |
| Function to compute the amplitude distribution of the output complex wavefield. Two parameters are necessary: | |
|
| intensity(output, log) |
| Function to compute the intensity distribution of the output complex amplitude wavefield. Two parameters are necessary: | |
|
| phase(output) |
| Function to compute the phase distribution of an output complex wavefield distribution. The only required parameter is the | |
|
| FT(input) |
| Function to compute the 2D Fourier transform of an image. The only required parameter is the image ( | |
|
| IFT(input) |
| Function to compute the 2D inverse Fourier transform of a spectral image. The only required parameter is the spectral image ( | |
|
| sfc(field, radius, centX, centY, display) |
| Function to filter the Fourier Transform of a hologram using a circular mask. The required parameters are: | |
|
| sfr(field, x1, x2, y1, y2, display) |
| Function to filter the Fourier Transform of a hologram using a rectangular mask. The required parameters are: | |
|
| sfmr(field, display) |
| Function to filter the Fourier Transform of a hologram using a user-defined rectangular mask from a popup window. The required parameters are the hologram ( | |
|
| HM2F(inp, kernel) |
| Function to apply the median-mean filter to reduce speckle noise [ |
Available functions in the phase-shifting package.
| Phase-shifting strategy | Specifications |
|---|---|
|
| PS5(inp0, inp1, inp2, inp3, inp4) |
| Function to reconstruct the phase distribution using 5 phase-shifted holograms with a phase shift of π/2. The required parameters are the five holograms. | |
|
| PS4(inp0, inp1, inp2, inp3) |
| Function to reconstruct the phase distribution using 4 phase-shifted holograms with a phase shift equal to π/2. The required parameters are the four holograms. | |
|
| PS3(inp0, inp1, inp2) |
| Function to reconstruct the phase distribution using 3 phase-shifted holograms with a phase shift equal to π/3. The required parameters are the three holograms. | |
|
| SOSR(inp0, inp1, inp2, inp3, upper, wavelength, dx, dy, s = 1, steps = 4) |
| Function to reconstruct the phase distribution using 4 phase-shifted holograms with a phase shift equal to π/2. This method is based on the SOSR approach proposed by De Nicola | |
|
| BPS3(inp0, inp1, inp2, wavelength, dx, dy) |
| Function to reconstruct the phase distribution using 3 phase-shifted holograms with an arbitrary and unknown phase shift. The input parameters are the three holograms ( | |
|
| BPS2(inp0, inp1, wavelength, dx, dy) |
| Function to reconstruct the phase distribution using 2 phase-shifted holograms with an arbitrary and unknown phase shift. This method is valid for slightly off-axis DHM systems operating in telecentric regime [ |
Fig 3Verification of the in-line PS function.
(a) An example code; (b) Simulated in-line DHM holograms of a phantom model. Panels (c)-(e) and the reconstructed phase images for the PS5, PS4, and PS3 strategies, respectively.
Fig 4Example of use of the slightly off-axis strategies.
(a) A sample code; (b) FT of recorded hologram showing that the DHM system is operating in slightly off-axis configuration. Panel (c) is the reconstructed phase image of a Fresnel lens by the SOSR function using four holograms with a π/2 phase shifting. Panels (d) and (e) are the reconstructed phase images of a USAF test target using the BPS3 and BPS2 strategies, respectively.
Available functions in the phase reconstruction package.
| Compensation method | Specifications |
|---|---|
|
| FRS(inp, upper, wavelength, dx, dy, s, step) |
| Function to reconstruct fully-compensated phase images using the full ROI search strategy [ | |
|
| ERS(inp, upper, wavelength, dx, dy, s, step) |
| Function to reconstruct fully-compensated phase images using the efficient ROI search strategy [ | |
|
| CFS(inp, wavelength, dx, dy) |
| Function to reconstruct fully-compensated phase images by minimizing a cost function [ | |
|
| CNT(inp, wavelength, dx, dy, x1, x2, y1, y2, spatialFilter) |
| Function to reconstruct fully-compensated phase images of holograms recorded in non-telecentric regime. The function requires up to nine parameters: |
Fig 5Example of the fully-compensated phase reconstruction package for off-axis DHM holograms recorded in telecentric configuration.
(a) A sample code; (b) FT of a recorded hologram to show that the DHM system operates in off-axis and telecentric configuration. Panels (c)-(d) are the fully-compensated reconstructed phase images of a Drosophila melanogaster fly using FRS and ERS functions. Panel (e) shows the fully-compensated reconstructed phase image of a star target using the CFS function.
Fig 6Example of the CNF function for off-axis DHM holograms recorded in a non-telecentric configuration.
(a) A sample code; (b) FT of a recorded hologram, notice that the hologram operates in off-axis and non-telecentric configuration. Panel (c) is the binarized image of the FT to select the dimensions of the rectangular filter with parameters (x1, x2, y1, y2). Panel (d) corresponds to the binarized reconstructed phase image after compensating the interfering angle, where X_cent and Y_cent positions are marked. Finally, panel (e) shows the reconstructed phase image of a Drosophila melanogaster fly with minimum phase distortions.
Available functions in the numerical propagation package.
| Propagator | Specifications |
|---|---|
|
| angularSpectrum(field, z, wavelength, dx, dy) |
| Function to propagate a complex distribution using the angular spectrum approach. | |
|
| fresnel(field, z, wavelength, dx, dy) |
| Function to propagate a complex distribution using the Fresnel Transform approach. | |
|
| bluestein(field, z, wavelength, dx, dy, dxout, dyout) |
| Function to propagate a complex distribution using the Fresnel-Bluestein transform approach. Note that the pixel size of the input ( |
Fig 7Example of the angular spectrum approach to numerically focus a hologram using a circular spatial filter tool.
Panel (a) is the sample code. Panels (b)-(d) show the hologram (b) and its spectrum without (c) and with (d) a circular mask. Panels (e)-(g) are the reconstructed intensity images for three propagation distances (z).
Fig 8Examples of the Fresnel and Fresnel-Bluestein propagation approaches to numerically focus holograms using a rectangular mask to filter the object frequencies from the hologram spectrum.
Panel (a) is the sample code. Panels (b) show the hologram spectrum (b) and the reconstructed intensity image without (c) and with (d) a rectangular mask of a horse model using the fresnel propagator. Panels (e)-(g) are the hologram spectrum (e), and the reconstructed intensity images after filtering the object frequencies from the hologram spectrum using two different magnifications [2× and 2.5× in panels (f) and (g), respectively] for a 1-cm edge dice using the bluestein propagator.