Skip to content

Commit

Permalink
Merge branch 'master' of github.com:fieldtrip/fieldtrip
Browse files Browse the repository at this point in the history
  • Loading branch information
robertoostenveld committed Sep 17, 2020
2 parents 2c3a17f + c4b26ed commit 7f7ecb2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 22 deletions.
52 changes: 31 additions & 21 deletions fileio/private/read_eyelink_asc.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
asc.ssacc = {};
asc.esacc = {};
asc.dat = [];
asc.sblink = {}; % blink parsing added
asc.eblink = {};
current = 0;

% read the whole file at once
Expand All @@ -46,28 +48,28 @@

for i=1:numel(aline)
tline = aline{i};

if numel(tline) && any(tline(1)=='0':'9')
% if regexp(tline, '^[0-9]')
% if regexp(tline, '^[0-9]')
tline = strrep(tline, ' . ', ' NaN '); % replace missing values
tmp = sscanf(tline, '%f');
nchan = numel(tmp);
current = current + 1;

if size(asc.dat, 1)<nchan
% increase the allocated number of channels
asc.dat(nchan,:) = 0;
end

if size(asc.dat, 2)<current
% increase the allocated number of samples
asc.dat(:,end+10000) = 0;
end

% add the current sample to the data matrix
asc.dat(1:nchan, current) = tmp;


elseif regexp(tline, '^INPUT')
[val, num] = sscanf(tline, 'INPUT %d %d');
this.timestamp = val(1);
Expand All @@ -77,35 +79,43 @@
else
asc.input = cat(1, asc.input, this);
end


elseif regexp(tline, '\*\*.*')
asc.header = cat(1, asc.header, {tline});


elseif regexp(tline, '^MSG')
asc.msg = cat(1, asc.msg, {tline});


elseif regexp(tline, '^SFIX')
asc.sfix = cat(1, asc.sfix, {tline});


elseif regexp(tline, '^EFIX')
asc.efix = cat(1, asc.efix, {tline});


elseif regexp(tline, '^SSACC')
asc.ssacc = cat(1, asc.ssacc, {tline});


elseif regexp(tline, '^ESACC')
asc.esacc = cat(1, asc.esacc, {tline});



elseif regexp(tline, '^SBLINK')
asc.sblink = cat(1, asc.sblink, {tline});


elseif regexp(tline, '^EBLINK')
asc.eblink = cat(1, asc.eblink, {tline});

else
% all other lines are not parsed
end

end

% remove the samples that were not filled with real data
Expand Down
2 changes: 1 addition & 1 deletion ft_artifact_eog.m
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
% settings for preprocessing
cfg.artfctdef.eog.bpfilter = ft_getopt(cfg.artfctdef.eog, 'bpfilter', 'yes');
cfg.artfctdef.eog.bpfreq = ft_getopt(cfg.artfctdef.eog, 'bpfreq', [1 15]);
cfg.artfctdef.eog.bpfiltord = ft_getopt(cfg.artfctdef.eog, 'bpfiltor', 4);
cfg.artfctdef.eog.bpfiltord = ft_getopt(cfg.artfctdef.eog, 'bpfiltord', 4);
cfg.artfctdef.eog.bpfilttype = ft_getopt(cfg.artfctdef.eog, 'bpfilttype', 'but');
cfg.artfctdef.eog.hilbert = ft_getopt(cfg.artfctdef.eog, 'hilbert', 'yes');

Expand Down

0 comments on commit 7f7ecb2

Please sign in to comment.