idt_filter: Dispersion-based fixation detection algorithm '(I-DT)'

View source: R/FixationFilterFunctions.R

idt_filterR Documentation

Dispersion-based fixation detection algorithm (I-DT)

Description

Apply a dispersion-based fixation (I-DT) filter to the eye tracking data. The algorithm identifies fixations as samples clustering within a spatial area. The procedure is described in Blignaut 2009 Input data must be a data frame with the variables timestamp, x.raw and y.raw as variables. Other variables can be included but will be ignored. This function does not perform pre-processing in the form of interpolation or smoothing. Use the function process.gaze for this. Timestamps are assumed to be in milliseconds. Default settings assume that x and y coordinates are in pixels. The output data is a list with two data frames: fixations includes all detected fixations with coordinates, duration and a number of other metrics, filt.gaze is a sample-by-sample data frame with time stamps, raw and filtered gaze coordinates. The function can be slow for long recordings and/or data recorded at high sampling rates.

Usage

idt_filter(
  gaze_raw,
  one_degree = 40,
  dispersion.threshold = 1,
  min.duration = 50,
  xcol = "x.raw",
  ycol = "y.raw",
  distance.threshold = 0.7,
  merge.ms.threshold = 75,
  missing.samples.threshold = 0.5
)

Arguments

gaze_raw

Data frame with unfiltered gaze data. Include the variable timestamp with timing in ms and columns with raw x and y data as specified by the paramerers xcol and ycol or their default values

one_degree

One degree of the visual field in the unit of the raw x and y coordinates, typically pixels

dispersion.threshold

Maximum radius of fixation candidates. Samples clustering within a circle of this limit will be classified as a fixation if the duration is long enough.

min.duration

Minimum duration of fixations in milliseconds

xcol

Name of the column where raw x values are stored. Default: x.raw

ycol

Name of the column where raw y values are stored. Default: y.raw

distance.threshold

Subsequent fixations occurring withing this distance are merged. Set to 0 if you don't want to merge fixations.

merge.ms.threshold

Only subsequent fixations occurring within this time window are merged

missing.samples.threshold

Remove fixations with a higher proportion of missing samples. Range 0-1

Value

list including separate data frames for fixations and sample-by-sample data including filtered and unfiltered data. The fixations data frame includes onset, offset, x, y, RMSD and missing samples of each fixation.

Examples

idt_data <- idt_filter(sample.data.processed)

kollaR documentation built on April 13, 2025, 5:11 p.m.