Back to the main page.

Bug 2413 - improve support for eye tracker data

Status ASSIGNED
Reported 2013-12-05 13:59:00 +0100
Modified 2016-07-21 10:38:47 +0200
Product: FieldTrip
Component: documentation
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P3 normal
Assigned to: Diego Lozano Soldevilla
URL:
Tags:
Depends on:
Blocks:
See also: http://bugzilla.fcdonders.nl/show_bug.cgi?id=2525http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=3050

Robert Oostenveld - 2013-12-05 13:59:53 +0100

Alina was wondering if Fieldtrip has any functionality to work with eyelink eyetracker data. It can import eyelink .asc output, so we could plan some more functionality on this type of data.


Robert Oostenveld - 2013-12-05 14:07:43 +0100

I think it would make sense to have a documentation section at http://fieldtrip.fcdonders.nl/reading_data, i.e. main menu -> user documentation -> importing your data. That is where other "special" types of data are also listed. The page can be short, but should contain the following sections **Eyelink and MEG** "At the DCCN we record ... ADC channels ...." **Eyelink and EEG** "it is possible to record ... ExG ..., however at the DCCN we record them separately. Hence ... (explain how to synchronize) ..." **Eyelink on its own** Explain how to read the asc data and deal with stimulus presentation events etc.


Robert Oostenveld - 2013-12-05 14:18:36 +0100

I noticed it was not in the help of the reading functions mac001> svn commit Sending fileio/ft_read_header.m Transmitting file data . Committed revision 8974. and Committed revision 8975. I also updated http://fieldtrip.fcdonders.nl/dataformat


Diego Lozano Soldevilla - 2014-01-08 00:39:31 +0100

Hi Alina, I'm going to improve the eyelink data analysis in fieldtrip and it'd help me a lot if you can share with us EEG+eyetracker data (one block will be enough). The idea is to adapt fieldtrip to the following data situations (see Robert's comment): **Eyelink and MEG** (I can use my data) **Eyelink and EEG** (Alina?) **Eyelink on its own** (I can use my data)


Diego Lozano Soldevilla - 2014-04-03 14:24:25 +0200

(In reply to Diego Lozano Soldevilla from comment #3) Eyelink getting started ready for donders people: http://fieldtrip.fcdonders.nl/getting_started/eyelink For now there's only for eyelink data alone and for MEG+eyelink but can easily extended to EEG+eyelink. I propose to use this getting started to talk a bit about how to synchronize the different recording modalities and leave for the tutorial how to detect (micro)saccades and how to link them to continuous data so forth


Diego Lozano Soldevilla - 2014-04-03 15:58:48 +0200

(In reply to Diego Lozano Soldevilla from comment #4) Long discussion with Robert about how eyetracker data should be represented in Fieldtrip. He came out with the idea to represent (micro)saccades as spike data structures. First approach would be to create a "ft_saccade_detection" function identifying (micro)saccades similarly as in ft_spike_detection. Adapting the general rationale behing the spike representation we would be in a position to do compute classic (micro)saccades analysis as: - Peristimulus saccade histograms locked to the stimuli. This would be an adaptation from ft_spike_psth/ft_spike_plot_raster (i.e. figure 5a here http://www.sciencedirect.com/science/article/pii/S0042698903000841). It's also interesting to have a look to ft_datatype_segmentation function to get an idea about how to represent number with strings attached to them: i.e. left eye vertical channel as string and the ocurrence (time) of the microsaccades - Eye movement classification. I discussed together with Jarrod Dowdall (Fries lab) our plans to develop basic rutines for eye movement detection. He has a lot of expertise that wouldn't mind to share with us. He explained me how to classify eyemovements using different features as position, velocity, acceleration, peak-to-peak microsaccade... A first approach would be to develop a function in line with ft_spike_waveform to classify saccades with a PCA+kmeans on velocity vs amplitude plots (see Figure 2 http://www.sciencedirect.com/science/article/pii/S0042698903000841) - Think about how data convertions could and should occur. Bigger picture: We can analyze: a) continuous data: electrophysiological/eyemovement recordings b) events: triggers/stimuli we use to synchronize paradigm and recordings c) spike/(micro)saccades: especial events the we'd generate by data analysis of recordings. Can be viewed as: 1) "events/triggers" to timelock your continuous recordings 2) Discrete events that can be analyze by its own as the spikes or eye movements d) artifact: they mark the begining and the end of an event in time samples. We should think in ways to combine and convert this 4 different data representations to exploit data analysis. In some settings, the eyetracker-to-electrophysiological analysis could be more challenging. For example when the eyetracker sampling rate is slower than the MEEG sampling rate. We could adopt strategies as for the spike field coherence analysis that Robert, Thilo and Martin worked previously. In future, we could adopt the same analysis strategy to analyze rat movement recordings (slow sampling rate) with spike/fields as the place-field people do


Alina - 2014-04-04 13:01:58 +0200

Which function does the Fieldtrip use to parse the eye tracking data? If I use ft_definetrial and ft_preprocessing to read trials from the eyelink file, it creates a standard data structure with trials and everything else. But it also has fields data.hdr.orig where it stores the eyelink messages. For example, data.hdr.orig.sfix contains timestamps of fixation start as computed by the eyelink, data.hdr.orig.efix contains eyelink timestamps of fixation start, fixation end, duration and velocity, data.hdr.orig.msg contains miscellaneous messages (calibration data, stimulus onset time etc) Here is a file with preprocessed data so that you can have a look at it: https://www.dropbox.com/sh/9b5uyfu9j6t9hea/gcoSeFvJxH I would like to know which function pulls this information about saccades and fixations from the eyelink data file. Right now those numbers are stored as text strings and are partially concatenated, but it would be more useful to store them in an array. I know that you are working on your own algorithm for saccade detection, but while it's not there, I could also use the one implemented in Eyelink.


Diego Lozano Soldevilla - 2014-04-04 15:15:58 +0200

(In reply to Alina from comment #6) Hi Alina, This is indeed a very good point. See Bug 2525. The function you're looking for is fieldtrip/fileio/private/read_eyelink_asc.m. I'll do my best to solve it out soon


Diego Lozano Soldevilla - 2014-06-18 12:58:51 +0200

Created attachment 636 eye position


Diego Lozano Soldevilla - 2014-06-18 12:59:18 +0200

Created attachment 637 eye velocity


Diego Lozano Soldevilla - 2014-06-18 15:07:33 +0200

(In reply to Diego Lozano Soldevilla from comment #9) Progress and outline: - New function comming: ft_detect_movement It'll be not only useful for micro/saccade detection but also for more general purpose analysis concerning velocity changes. Joystic data, rat position (place-grid cell experiments), MEG head movements... - Its output will be a Nx3 matrix. The first and second columns will specify the begin and end samples of the thresholded velocity event (microsaccade, joystic movement...), and the third column will contain the peak velocity. This last thrid column might be relevant in some data representation to make a conversion. For example will allow to convert the micro/saccades from artifact to spike data representation. All relevant spike functions should be fully compatible to microsaccades expressed as spikes - Create FT_PLOT_MOVEMENT based on ft_plot_vector: Jorn will join the party!


Diego Lozano Soldevilla - 2014-07-04 14:54:42 +0200

(In reply to Diego Lozano Soldevilla from comment #10) First micro/saccade function ready to use: Adding ft_detect_movement.m Transmitting file data . Committed revision 9700. Next plans: - create FT_PLOT_MOVEMENT - cfg option to extract velocity data or should we create a FT function to get it independently?


Jörn M. Horschig - 2014-07-04 15:12:33 +0200

as movement and velocity are mathematically equivalent, I would vote for putting it all in one function ;)


Robert Oostenveld - 2014-07-04 15:15:42 +0200

(In reply to Jörn M. Horschig from comment #12) However, I do think that a separate function for "speed" would be appropriate.


Diego Lozano Soldevilla - 2014-07-04 15:31:27 +0200

(In reply to Robert Oostenveld from comment #13) I also see a benefit on making a FT function for speed. As ft_detect_movement will quite general, different methods would benefit for for different data analysis situations: - microsaccades, - joystick data - zebris - rats running in an arena - head position - dipole moments? ft_preproc_velocity or something more general as ft_preproc_conv?


Guillaume - 2014-09-22 14:17:45 +0200

The new function ft_detect_movement.m does not have any SVN properties set up: fieldtrip> svn proplist ft_detect_movement.m -v fieldtrip> Would it be possible to have svn:eol-style and svn:keywords added?


Diego Lozano Soldevilla - 2014-09-22 14:46:36 +0200

(In reply to Guillaume from comment #15) Hi Guillaume, Thanks for letting me know. Is this want to want? It's the first time I do this thing ;) svn propset svn:eol-style native ft_detect_movement.m svn propset svn:keywords 'Rev Id' ft_detect_movement.m svn proplist ft_detect_movement.m -v Properties on 'ft_detect_movement.m': svn:keywords Rev Id svn:eol-style native Transmitting file data . Committed revision 9822.


Guillaume - 2014-09-22 14:49:10 +0200

Thanks Diego, that's exactly what I wanted!


Diego Lozano Soldevilla - 2014-09-22 14:54:19 +0200

(In reply to Guillaume from comment #17) You're welcome! Feel free to feedback me about saccade functionality you'd wish to have in fieldtrip. Currently I'm finishing my PhD thesis and I cannot spend time on it but later I'll return later. Diego


Robert Oostenveld - 2014-09-22 17:21:06 +0200

(In reply to Diego Lozano Soldevilla from comment #16) Hi Diego, It is documented here http://fieldtrip.fcdonders.nl/development/svn#keeping_the_svn_repository_tidy I ran the "find ..." sections on all FT code (excluding external) and cleaned up some more properties. roboos@mac011> svn commit Transmitting file data ... Committed revision 9825.


Diego Lozano Soldevilla - 2014-09-22 21:36:27 +0200

(In reply to Robert Oostenveld from comment #19) Thank you Robert! I missed the wiki page


Stephen Whitmarsh - 2016-07-21 09:51:29 +0200

Hi there Diego et al., What is the status of this project/bug? I will we doing Eyelink events (+MEG) analyses soon, so it would be nice to know what works and what I could help out on. Best, Stephen


Diego Lozano Soldevilla - 2016-07-21 10:38:47 +0200

(In reply to Stephen Whitmarsh from comment #21) Hi Stephen, No progress so far regarding eyelink events so go ahead with it!