holopy.propagation package

Submodules

holopy.propagation.convolution_propagation module

Code to propagate objects/waves using scattering models.

propagate(data, d, medium_index=None, illum_wavelen=None, cfsp=0, gradient_filter=False)

Propagates a hologram along the optical axis

Parameters:
  • data (xarray.DataArray) – Hologram to propagate

  • d (float or list of floats) – Distance to propagate or desired schema. A list tells to propagate to several distances and return the volume

  • cfsp (integer (optional)) – Cascaded free-space propagation factor. If this is an integer > 0, the transfer function G will be calculated at d/csf and the value returned will be G**csf. This helps avoid artifacts related to the limited window of the transfer function

  • gradient_filter (float) – For each distance, compute a second propagation a distance gradient_filter away and subtract. This enhances contrast of rapidly varying features. You may wish to use the number that is a multiple of the medium wavelength (illum_wavelen / medium_index)

Returns:

data – The hologram progagated to a distance d from its current location.

Return type:

xarray.DataArray

Notes

holopy is agnostic to units, and the propagation result will be correct as long as the distance and wavelength are in the same units.

trans_func(schema, d, med_wavelen, cfsp=0, gradient_filter=0)

Calculates the optical transfer function to use in reconstruction

This routine uses the analytical form of the transfer function found in in Kreis [1]. It can optionally do cascaded free-space propagation for greater accuracy [2], although the code will run slightly more slowly.

Parameters:
  • schema (xarray.DataArray) – Hologram to obtain the maximum dimensions of the transfer function

  • d (float or list of floats) – Reconstruction distance. If list or array, this function will return an array of transfer functions, one for each distance

  • med_wavelen (float) – The wavelength in the medium you are propagating through

  • cfsp (integer (optional)) – Cascaded free-space propagation factor. If this is an integer > 0, the transfer function G will be calculated at d/csf and the value returned will be G**csf

  • gradient_filter (float (optional)) – Subtract a second transfer function a distance gradient_filter from each z

Returns:

trans_func – The calculated transfer function. This will be at most as large as shape, but may be smaller if the frequencies outside that are zero

Return type:

xarray.DataArray

References

holopy.propagation.point_source_propagate module

interpolate2D(data, i, j, fill=None)

Interpolates values from a 2D array (data) given non-integer indecies i and j. If [i,j] is outside of the shape of data, fill is returned. If fill=None, the value of the closest edge pixel to (i,j) is used.

ps_propagate(data, d, L, beam_c, out_schema=None)

Propagates light back through a hologram that was taken using a diverging reference beam.

Parameters:
  • be (data is a holopy Xarray. It is the hologram to reconstruct. Must)

  • square. (square. The pixel spacing must also be)

  • image (d = distance from pinhole to reconstructed)

  • is (in meters (this)

  • array. (z in Jericho and Kreuzer). Can be a scalar or a 1D list or)

  • pinhole (L = distance from screen to)

  • meters (in)

  • [x (beam_c =)

  • center (y] coodinates of beam)

  • pixels (in)

  • spacing (out_schema = size of output image and pixel)

  • schema (default is the)

  • data. (of)

Return type:

an image(volume) corresponding to the reconstruction at plane(s) d.

Notes

Only propagation through media with refractive index 1 is supported. This is a wrapper function for ps_propagate_plane() This function can handle a single reconstruction plane or a volume.

Based on the algorithm described in Manfred H. Jericho and H. Jurgen Kreuzer, “Point Source Digital In-Line Holographic Microscopy,” Chapter 1 of Coherent Light Microscopy, Springer, 2010. http://link.springer.com/chapter/10.1007%2F978-3-642-15813-1_1

ps_propagate_plane(data, d, L, beam_c, out_schema=None, old_Ip=False)

Propagates light back through a hologram that was taken using a diverging reference beam.

Parameters:
  • square. (The pixel spacing must also be)

  • square.

  • image (if Ip is an)

  • in (in meters (this is z)

  • scalar. (Jericho and Kreuzer). Must be a)

  • pinhole (L = distance from screen to)

  • meters (in)

  • [x (beam_c =)

  • center (y] coodinates of beam)

  • pixels (in)

  • spacing (out_schema = size of output image and pixel)

  • schema (default is the)

  • data. (of)

  • True (if Ip ==)

  • stack (returns Ip to be used on calculations in the)

  • normal (if Ip == False compute reconstructed image as)

  • image

  • calculations (use this to speed up)

Return type:

returns an image(volume) corresponding to the reconstruction at plane(s) d.

Notes

Propataion can be to one plane only. Only propagation through media with refractive index 1 is supported.

Based on the algorithm described in Manfred H. Jericho and H. Jurgen Kreuzer, “Point Source Digital In-Line Holographic Microscopy,” Chapter 1 of Coherent Light Microscopy, Springer, 2010. http://link.springer.com/chapter/10.1007%2F978-3-642-15813-1_1