Flexible, Extensible, & Reproducible Pupillometry Preprocessing
Add unique event identifiers to handle duplicate event messages
Add unique identifiers to a single events data frame
Save out pupil time series data in a BIDS-like structure
Bin pupil data into specified time bins
Bin pupil time series by averaging within time bins
Calculate Euclidean distance between points
Calculate confounds for epoched data
Check and create directory if it doesn't exist
Check for Arrow availability
Check baseline and epoch counts match
Check baseline input arguments
Check if baseline mean is zero
Check if column exists in data frame
Check if object is of class eyeris
Check for DuckDB availability
Check epoch input for plotting
Check epoch manual input data structure
Check epoch manual input data frame format
Check epoch message values against available events
Check if input argument is provided
Check limits in wildcard mode
Check if pupil_raw column exists
Check start and end timestamps are balanced
Check time series monotonicity
Clean string by removing non-alphanumeric characters
Clean up individual image files in run directories after HTML generati...
Clean up source figures after report generation
Cleanup temporary database
Compute baseline correction for epoch data
Create or connect to eyeris project database
Convert nested data.table objects to tibbles
Count epochs and validate data is epoched
Create a counter progress bar
Create zip file from epoch images
Create table name for eyeris data
Create temporary database for parallel processing
Internal function to remove blink artifacts from pupil data
NA-pad blink events / missing data
Internal function to remove transient artifacts from pupil data
Remove pupil samples that are physiologically unlikely
Internal function to detrend pupil data
Detrend the pupil time series
Disconnect from eyeris database
Internal function to downsample pupil data
Downsample pupil time series with anti-aliasing filtering
Draw vertical lines at NA positions
Draw random epochs for plotting
Block-by-block epoch and baseline handler
Manually epoch using provided start/end data frames of timestamps
Epoch based on a single event message (without explicit limits)
Main epoching and baselining logic
Epoch using a start and an end message (explicit timestamps)
Epoch using a start message with fixed limits around it
Epoch (and baseline) pupil data based on custom event message structur...
Handle errors with custom error classes
Evaluate pipeline step parameters
Export confounds data to CSV files and/or database
Extract baseline epochs from time series data
Extract event identifiers from event messages
Access example EyeLink .asc binocular mock dataset file provided by th...
Access example EyeLink .asc demo dataset file provided by the eyeris p...
Run eyeris commands with automatic logging of R console's stdout and...
Default color palette for eyeris plotting functions
Extract and aggregate eyeris data across subjects from database
Connect to eyeris project database (user-facing)
Disconnect from eyeris database (user-facing)
List available tables in eyeris database
Read eyeris data from database
Reconstruct eyerisdb from chunked files
Split eyerisdb for data sharing and distribution
Get summary statistics for eyeris database
Export eyeris database to chunked files
Split eyeris database into N parquet files by data type
eyeris: Flexible, Extensible, & Reproducible Pupillometry Preprocessin...
Filter epoch names from eyeris object
Find baseline structure name for a given epoch
Format call stack information for display
Extract block numbers from eyeris object or character vector
Calculate confounds for a single pupil data step
Get formatted timestamp for logging
Obtain timestamps from events data
Internal glassbox function for processing individual eyes
The opinionated "glass box" eyeris pipeline
Index metadata from data frame
Interpolate missing pupil data using linear interpolation
Interpolate missing pupil samples
Check if object is a binocular eyeris object
Load and parse SR Research EyeLink .asc files
Log an error message and abort
Log an informational message
Core logging function with timestamp and glue support
Log a success message
Log a warning message
Standardized logging functions for eyeris
Internal function to lowpass filter pupil data
Lowpass filtering of time series data
Create baseline label for epoch data
Make a BIDS-compatible filename
Generate epoch label from events and data
Create interactive epoch gallery report
Create multiline markdown table from data frame
Create markdown table from data frame
Create progressive preprocessing summary plot
Create eyeris report
Process event messages and merge with time series
Merge temporary database into main database
Normalize gaze coordinates to screen-relative units
Parse call stack information
Parse EyeLink version and model information
Build a generic operation (extension) for the eyeris pipeline
Plot binocular correlation between left and right eye data
Internal helper to plot detrending overlay
Create gaze heatmap of eye coordinates
Plot pupil distribution histogram
Plot with seed handling for glassbox pipeline
Plot pre-processed pupil data from eyeris
Print lightbox image HTML (legacy)
Print lightbox image HTML for zip-based gallery
Print plots in markdown format
Process large database query in chunks
Epoch and baseline processor
Process eyeris data and create eyeris object
Create a progress bar for tracking operations
Prompt user for continuation
Read parquet files back into R
Render R Markdown report
Robust plotting function with error handling
Internal function to run bidsify on a single eye
Sanitize event tag string into canonical epoch label
Save detrend plots for each block
Save progressive summary plots for each block
Check if binocular correlations should be plotted
Slice epoch from raw time series data
Slice epochs with no explicit limits
Slice epochs with explicit limits
Calculate pupil speed using finite differences
Extract confounding variables calculated separately for each pupil dat...
Tag blinks in pupil data
Tag gaze coordinates as on/off screen
Tick a progress bar
Write data to CSV and/or database (helper function)
Write eyeris data to database
Zip and cleanup source figure files
Internal function to z-score pupil data
Z-score pupil time series data
Pupillometry offers a non-invasive window into the mind and has been used extensively as a psychophysiological readout of arousal signals linked with cognitive processes like attention, stress, and emotional states [Clewett et al. (2020) <doi:10.1038/s41467-020-17851-9>; Kret & Sjak-Shie (2018) <doi:10.3758/s13428-018-1075-y>; Strauch (2024) <doi:10.1016/j.tins.2024.06.002>]. Yet, despite decades of pupillometry research, many established packages and workflows to date lack design patterns based on Findability, Accessibility, Interoperability, and Reusability (FAIR) principles [see Wilkinson et al. (2016) <doi:10.1038/sdata.2016.18>]. 'eyeris' provides a modular, performant, and extensible preprocessing framework for pupillometry data with BIDS-like organization and interactive output reports [Esteban et al. (2019) <doi:10.1038/s41592-018-0235-4>; Gorgolewski et al. (2016) <doi:10.1038/sdata.2016.44>]. Development was supported, in part, by the Stanford Wu Tsai Human Performance Alliance, Stanford Ric Weiland Graduate Fellowship, Stanford Center for Mind, Brain, Computation and Technology, NIH National Institute on Aging Grants (R01-AG065255, R01-AG079345), NSF GRFP (DGE-2146755), McKnight Brain Research Foundation Clinical Translational Research Scholarship in Cognitive Aging and Age-Related Memory Loss, American Brain Foundation, and the American Academy of Neurology.
Useful links