# DHM Utilities/Reconstruction

Reconstruction | |
---|---|

Project | ImageJ |

Source | on GitHub |

License | LGPLv3 |

Development status | Active |

Support status | Active |

Team | |

Founders | David Cohoe ([1]) |

Leads | David Cohoe |

Developers | David Cohoe |

Debuggers | David Cohoe |

Reviewers | David Cohoe |

Support | David Cohoe |

Maintainers | David Cohoe |

Reconstruction is a plugin to reconstruct holograms and perform numerical propagation, with a focus on holograms produced by DHM. The plugin is highly extendable, with anybody able to add new plugins within it to perform whatever process they want at any point in the reconstruction pipeline. By default, it includes support for angular spectrum propagation, and for various noise removal techniques such as a reference hologram and a polynomial fit algorithm.

## Overview

When running the command, a dialog box will pop up asking for parameters for all enabled plugins. The parameters that are always there are as follows:

- Hologram(s): The hologram stack to reconstruct. This plugin is capable of reconstructing a stack of images through time.
- Wavelength: The wavelength of light used to acquire the hologram.
- Image Width: The width of the hologram, in real units.
- Image Height: The height of the hologram, in real units.
- t slice selection: The time slices to reconstruct from the original hologram stack. See below for more info on how each choice works.
- Z plane selection: The z planes to propagate to. See below for more info on how each choice works.

Once you have finished with the dialog, the command will perform the following algorithm:

- From the original hologram, get the filter on the Fourier transform of the hologram to use.
- For each time slice selected, do the following:
- Filter the hologram
- For each z plane selected, do the following:
- Propagate the field

Plugins can insert their own operations at any point during this process. For example, the Reference Hologram plugin removes noise after filtering each time slice, and the Result plugin gets the final result after propagating the field.

### t slice selection

The t slice selection sets which frames of the hologram stack you want to reconstruct. It will not show up if the hologram you selected only has one time slice. The different options for choosing t slices are as follows:

- Single: Reconstruct only a single frame from the hologram stack.
- Current Frame: Reconstruct only the current selected frame from the hologram stack.
- All: Reconstruct all frames from the hologram stack.
- List: Reconstruct any arbitrary frames, as a comma-separated list of time values.
- Range: Reconstruct a range of t slices, given a starting point, ending point, and step size. For example, if your starting point was 2, your ending point 8, and your step size 2, it would reconstruct slices 2, 4, 6, and 8.
- Continuous Range: The same as Range, but with the step size set to one.

### Z plane selection

The Z plane selection sets which z values you want to propagate to. The different options for choosing z value are as follows:

- Single: Propagate only to a single particular z value.
- List: Propagate to any arbitrary z values, as a comma-separated list of time values.
- Range: Propagate to a range of z planes, given a starting point, ending point, and step size. For example, if your starting point was -1 μm, your ending point 1 μm, and your step size 0.5 μm, it would propagate to -1 μm, -0.5 μm, 0 μm, 0.5 μm, and 1 μm.

## Default Plugins in Detail

### Filter

The Filter plugin acquires and applies a filter on the Fourier transform of the hologram. When run from the command, it will show a window with the Fourier transform and ask the user to select an ROI for the filter. When running the command from code, you may use whatever ROI you wish. Many other plugins use the Filter plugin as well so that they can use the same filter.

### Polynomial Tilt Correction

The Polynomial Tilt Correction plugin performs tilt correction using a polynomial fit to the phase, as specified in this paper. The gist of the algorithm is that you find horizontal and vertical lines that *should* be flat, then find a polynomial fit to those lines, and subtract those polynomials from the phase. When you use this plugin, on the dialog it will ask for the polynomial degree to use. In our use, the only issues we have had were a linear tilt from a bad selection for the filter, but you may use whatever you wish.

The flat line determination is the interesting part. This is configurable through plugins, with three defaults:

#### Auto

The Auto plugin determines the flat lines automatically. For each direction, it picks up to ten lines and finds the polynomial fit on each one. It then uses a least-squares approach to find which polynomial fits its respective line the best, and then chooses that line. It has no extra parameters.

#### Middle

The Middle plugin uses the lines crossing through the middle of the image as the flat lines. It has no extra parameters.

#### Manual

The Manual plugin lets the user input their own lines. It has several extra parameters:

- Pixel value for horizontal line: The y pixel value that the horizontal line will be on.
- Horizontal line start: The x pixel value that the horizontal line will start at.
- Horizontal line end: The x pixel value that the horizontal line will end at.
- Pixel value for vertical line: The x pixel value that the vertical line will be on.
- Vertical line start: The y pixel value that the vertical line will start at.
- Vertical line end: The y pixel value that the vertical line will end at.