detransient_pupil {eyeris} | R Documentation |
Internal function to remove transient artifacts from pupil data
Description
This function implements transient artifact removal by
identifying and removing samples that exceed a speed-based threshold.
The threshold is computed based on the constant n
, which defaults to
the value 16
.
This function is called by the exposed wrapper detransient()
.
Usage
detransient_pupil(x, prev_op, n, mad_thresh)
Arguments
x |
A data frame containing pupil data with columns |
prev_op |
The name of the previous operation's pupil column |
n |
The constant used to compute the median absolute deviation (MAD)
threshold. Defaults to |
mad_thresh |
The threshold used to identify transient artifacts.
Defaults to |
Details
The function works by:
Calculating the speed of pupil changes using finite differences
Identifying samples that exceed a speed-based threshold
Removing these samples from the pupil data
Value
A numeric vector of the same length as the input data with transient artifacts removed (set to NA)