Back to the main page.

Bug 1327 - reading ASC eyelink files - doesn't recognize 'em as such

Reported 2012-02-13 18:24:00 +0100
Modified 2019-08-10 12:03:46 +0200
Product: FieldTrip
Component: fileio
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Diego Lozano Soldevilla
Depends on:
See also:

Stephen Whitmarsh - 2012-02-13 18:24:40 +0100

My normal workaround specifying header/datatype when working with .ASC (converted Eyelink data) doesn't work in ft_artifact_zvalue since it calls ft_read_data on it's own without taking (all) cfg opt with'm. @705: data = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', trl(trlop,1), 'endsample', trl(trlop,2), 'chanindx', sgnind, 'checkboundary', strcmp(cfg.continuous,'no')); which breaks @950 (unsupported data format) and that is because of ft_filetype falsely recognizing it as itab_asc instead of eyelink.

Jan-Mathijs Schoffelen - 2012-02-13 19:31:43 +0100

I guess adding the key-value pair 'dataformat', cfg.dataformat would solve it, correct?

Robert Oostenveld - 2012-02-13 21:30:03 +0100

all functions that call ft_read_header and/or ft_read_data should support the options cfg.headerformat and cfg.dataformat. Most do. Also ft_artifact_zvalue does it on line 185, but indeed not later. When fixing, please also fix the following omissions: mbp> grep -L headerformat `grep -l ft_read_header *.m` ft_headmovement.m ft_qualitycheck.m mbp> grep ft_read_data *.m | grep -v dataformat ft_artifact_zvalue.m: data = ft_read_data(cfg.datafile, 'header', hdr, 'begsample', trl(trlop,1), 'endsample', trl(trlop,2), 'chanindx', sgnind, 'checkboundary', strcmp(cfg.continuous,'no')); ft_spikedownsample.m: buf = ft_read_data(cfg.dataset, 'header', hdr, 'begsample', begsample(j), 'endsample', endsample(j), 'chanindx', i); mbp> grep ft_read_header *.m | grep -v headerformat ft_headmovement.m:hdr = ft_read_header(cfg.headerfile); ft_qualitycheck.m: info.hdr = ft_read_header(cfg.dataset); ft_rejectartifact.m: hdr = ft_read_header(cfg.headerfile);

Jan-Mathijs Schoffelen - 2012-02-14 08:52:27 +0100

Hi Stephen, do you have enough input to fix it?

Stephen Whitmarsh - 2012-02-14 20:12:30 +0100

I think so, just have to make sure it is passed through.

Diego Lozano Soldevilla - 2013-02-14 11:43:42 +0100

(In reply to comment #4) Checked: using the headerformat and dataformat solves the issue cfg = []; cfg.trialfun = 'trialselec'; cfg.trialdef.epochmoving= 'multnormal_rt'; cfg.dataset = [gendir dgendir(subj,1).name indir d(1,1).name]; cfg.headerformat = 'eyelink_asc'; cfg.dataformat = 'eyelink_asc'; cfg.trialdef.eventtype = 'INPUT'; cfg.trialdef.prestim = 1; cfg.trialdef.poststim = 3; cfg.trialdef.eventvalue = [2 3 4 5 6]; cfg.trialdef.buttonresp = [97 98]; cfg = ft_definetrial(cfg); cfg = trialfun: @trialselec trialdef: [1x1 struct] dataset: 'H:\electromag\dieloz\MEG\VOGBNZ_3016028.01\participants\VOGBNZdielozS02/Session1/eyelink/original/BNz02.asc' headerformat: 'eyelink_asc' dataformat: 'eyelink_asc' callinfo: [1x1 struct] version: [1x1 struct] trackconfig: 'off' checkconfig: 'loose' checksize: Inf showcallinfo: 'yes' debug: 'no' trackcallinfo: 'yes' trackdatainfo: 'no' trackparaminfo: 'no' datafile: 'H:\electromag\dieloz\MEG\VOGBNZ_3016028.01\participants\VOGBNZdielozS02/Session1/eyelink/original/BNz02.asc' headerfile: 'H:\electromag\dieloz\MEG\VOGBNZ_3016028.01\participants\VOGBNZdielozS02/Session1/eyelink/original/BNz02.asc' event: [1x2342 struct] trl: [240x4 double] channel: {'2' '3'} demean: 'no'

Diego Lozano Soldevilla - 2013-02-14 11:44:02 +0100


Robert Oostenveld - 2019-08-10 12:03:46 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue describing the issue on