pymovements.events.idt.idt

pymovements.events.idt.idt(positions: list[list[float]] | np.ndarray, dispersion_threshold: float, duration_threshold: int) list[Fixation][source]

Fixation identification based on dispersion threshold.

The algorithm identifies fixations by grouping consecutive points within a maximum separation (dispersion) threshold and a minimum duration threshold. The algorithm uses a moving window to check the dispersion of the points in the window. If the dispersion is below the threshold, the window represents a fixation, and the window is expanded until the dispersion is above threshold.

The implementation is based on the description and pseudocode from Salvucci and Goldberg [Salvucci and Goldberg, 2000].

Parameters
  • positions (array-like, shape (N, 2)) – Continuous 2D position time series

  • dispersion_threshold (float) – Threshold for dispersion for a group of consecutive samples to be identified as fixation

  • duration_threshold (int) – Minimum fixation duration in number of samples

Returns

List of Fixation events

Return type

list[Fixation]

Raises

ValueError – If positions is not shaped (N, 2) If dispersion_threshold is not greater than 0 If duration_threshold is not greater than 0