optimap.phaseΒΆ
Functions for computing, filtering, and analyzing phase maps from videos, and for detecting phase singularities.
- optimap.phase.compute_phase(video, offset=-0.5)[source]ΒΆ
Computes phase using Hilbert transformation, takes a normalized video or time-series as input.
- Parameters:
video ({t, x, y} ndarray) β normalized video
offset (float) β offset to add to video before computing phase, default is -0.5
- Returns:
phase in range [-pi, pi]
- Return type:
{t, x, y} ndarray
- optimap.phase.detect_phase_singularities(phase: ndarray, separate_by_charge=False)[source]ΒΆ
Detect phase singularities in a phase map video using [Iyer and Gray, 2001] method. Unlike [Iyer and Gray, 2001], the phase integral used here is only over four pixels.
TODO: verify if positions are (x, y) or (y, x)
- Parameters:
phase (ndarray) β Phase map video, shaped {t, x, y}
separate_by_charge (bool, optional) β Whether to separate phase singularities by charge, by default False See return value for details.
- Returns:
list of tuples β List of phase singularities for each frame (if separate_by_charge is False)
(list of tuples, list of tuples) β (positive_ps_list, negative_ps_list) (if separate_by_charge is True)
- optimap.phase.phasefilter_angle_threshold(phase: ndarray, wx: int, wy: int, wt: int, tr_angle: float, mask: ndarray | None = None)[source]ΒΆ
Remove outliers in a phase video by comparing them against their neighbors in space and time.
- Parameters:
- Returns:
phase video with outliers removed
- Return type:
{t, x, y} ndarray
- optimap.phase.phasefilter_disc(phase: ndarray, wx: int, wy: int, wt: int, mask: ndarray | None = None)[source]ΒΆ
TODO: Docstring for phasefilter_disc.