QITI / pySLM2

Apache License 2.0
3 stars 1 forks source link

Clear holography algorithms #15

Closed brandondube closed 4 months ago

brandondube commented 9 months ago

This issue is part of my JOSS review at https://github.com/openjournals/joss-reviews/issues/6315

Your paper writes,

The package implements the hologram generation algorithms of the Lee hologram (Lee, 1978) and its improved predecessors (Shih et al., 2021; Zupancic et al., 2016), targeting the digital micromirror device (DMD) based SLM with binary amplitude controls. It also implements the Gerchberg-Saxton algorithm (Gerhberg & Saxton, 1972) suitable for liquid crystal on silicon (LCoS) based SLMs with pure phase controls.

And later,

Currently, pySLM2 supports two type of the spatial light modulator (SLM), liquid crystal on silicon (LCoS) SLM and digital micromirror device (DMD). The LCoS SLM modulates the phase profile purely without modifying the amplitude. As the time of writing, Gerchberg-Saxton (GS) (Gerhberg & Saxton, 1972) algorithm and the mixed-region amplitude freedom (MRAF) algorithm (Gaunt & Hadzibabic, 2012) are included.

On the other hand, DMDs use micromirrors to locally turn on and off the light by toggling the micromirrors between two directions. This allows binary amplitude control. By periodically turning on and off the micromirrors across the DMD to form grating patterns, diffracted beams with controllable phase and amplitude can be engineered to have the desired beam profiles. As the time of writing, a randomized algorithm (Zupancic et al., 2016) and an iterative Fourier transformation algorithm (Motlakunta et al., 2023; Shih et al., 2021) are provided for hologram generation.

These seem somewhat contradictory; the first quote implies Lee's hologram algorithm is present in the package, the latter pair imply it is not. I was not able to find it. All I could find is in _lib.py, the def calculate_dmd_grating function and the routines it calls. I was surprised that none of the code in _lib.py indicates which function is which algorithm. Could you please name the functions or add to their documentation which is which?

Unrelatedly, a grammar issue: ...improved predecessors is improper English. To be a predecessor, Shih et al or Zupancic et al would have had to publish their algorithms before Lee. These could perhaps be considered "successors" but are more aptly "improved alternatives."

ldes89150 commented 5 months ago

These seem somewhat contradictory; the first quote implies Lee's hologram algorithm is present in the package, the latter pair imply it is not. I was not able to find it. All I could find is in _lib.py, the def calculate_dmd_grating function and the routines it calls. I was surprised that none of the code in _lib.py indicates which function is which algorithm. Could you please name the functions or add to their documentation which is which?

Documentation for the algorithms added: https://pyslm2.pages.dev/algorithm The Lee hologram corresponds to the ideal and the simple methods.

ldes89150 commented 5 months ago

Unrelatedly, a grammar issue: ...improved predecessors is improper English. To be a predecessor, Shih et al or Zupancic et al would have had to publish their algorithms before Lee. These could perhaps be considered "successors" but are more aptly "improved alternatives."

Fixed!