InverseFourierTransform#

class deeptrack.holography.InverseFourierTransform(**kwargs)#

Bases: Feature

Applies a power of the forward or inverse propagation matrix to an optical field.

This operation simulates multiple propagation steps in Fourier optics. Negative values of i apply the inverse transformation.

Parameters#

Tz: np.ndarray

Forward propagation matrix.

Tzinv: np.ndarray

Inverse propagation matrix.

i: int

Power of the propagation matrix to apply. Negative values apply the inverse.

Methods#

get(image: Image | np.ndarray, padding: int, **kwargs: dict[str, Any]) -> np.ndarray

Applies the power of the propagation matrix to the image.

Returns#

Image | np.ndarray

The transformed image.

Examples#

>>> import deeptrack as dt
>>> import numpy as np
>>> Tz = np.random.rand(128, 128) + 1j * np.random.rand(128, 128)
>>> Tzinv = 1 / Tz
>>> field = np.random.rand(128, 128, 2)
>>> transformed_field = dt.holography.FourierTransformTransformation(
>>>     Tz, Tzinv, i=2,
>>> )(field)

Methods Summary

get(image[, padding])

Computes the inverse Fourier transform and removes padding.

Methods Documentation

get(image: Image | np.ndarray, padding: int = 32, **kwargs: dict[str, Any]) Image | np.ndarray#

Computes the inverse Fourier transform and removes padding.

Parameters#

image: Image or ndarray

The image to transform.

padding: int, optional

Number of pixels removed symmetrically after inverse transformation (default is 32).

**kwargs: dict of str to Any

Returns#

np.ndarray

The inverse Fourier transform of the image.