-
Notifications
You must be signed in to change notification settings - Fork 23
Eye processing
Eye gaze data can be very informative for MoBI analysis, especially blink events are an option to do event-based analysis of data captured in the wild. The bemobil_clean_eye
function cleans eye gaze data by detecting blinks based on pupil radius data and interpolating them using pchip interpolation. Eyeblink events are added to the events of the data sets and blink extraction information is stored in the etc struct field of the data set which allows copying the events between synchronized data sets.
The blink detection is modified from code written by Ravi Chacko with support from the Intramural Research Program of the National Institute of Mental Health (ZIAMH002886) and the Signal Processing and Instrumentation Section in the NIH Center for Information Technology. Please cite: Mitz, A. R., Chacko, R. V., Putnam, P. T., Rudebeck, P. H., & Murray, E. A. (2017). Using pupil size and heart rate to infer affective states during behavioral neurophysiology and neuropsychology experiments. Journal of neuroscience methods, 279, 1–12. https://doi.org/10.1016/j.jneumeth.2017.01.004
An example of the entire eye data processing based on imported physio
data can be found in the example_bemobil_process_all_eye_data.m
script. Several plots are created along the way. First the raw data is plotted as a comparison:
Then the pupil radius specifically is plotted, including the cleaned version and the detected blink events:
This is best also saved as a MATLAB .fig file which means it can be zoomed in and moved for closer inspection:
The blinks are interpolated not only in the pupil radius channels but also in all other channels, leading to the cleaned data plot:
Lastly, it is useful to check the screen coordinate plot before and after cleaning:
Since the data of physio and EEG streams are synchronized when imported with the BeMoBIL pipeline, the created blink events can be directly copied back to the EEG data. When inspecting the vertical eye component after ICA, it can be checked whether the blink events from the eye tracker correspond with the blinks in the EEG:
Importantly, while blink events can also be detected in the EEG component, this component also contains vertical eye movement in general, which is ignored in the eye-tracking blink detector:
Additionally, the eye-tracking blink detector has a much higher temporal resolution than the electric potential and blinks in quick succession can still be detected:
If you have any comments, questions, or suggestions, please open issues here on git, join our discord server, or write an email to marius.s.klug@gmail.com!