Skip to content

Commit

Permalink
Merge pull request #4 from sccn/v1.12
Browse files Browse the repository at this point in the history
Copied v1.12 files over from eeglab plugin download
  • Loading branch information
chkothe committed Mar 1, 2016
2 parents 0238bc4 + f4b6915 commit d5f9229
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
12 changes: 9 additions & 3 deletions Matlab/eeg_load_xdf.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
if args.effective_rate && isfinite(stream.info.effective_srate) && stream.info.effective_srate>0
raw.srate = stream.info.effective_srate;
else
raw.srate = str2num(stream.info.nominal_srate);
raw.srate = str2num(stream.info.nominal_srate); %#ok<ST2NM>
end
raw.xmin = 0;
raw.xmax = (raw.pnts-1)/raw.srate;
Expand Down Expand Up @@ -108,19 +108,24 @@

% events...
event = [];
if isfinite(stream.info.effective_srate) && stream.info.effective_srate>0
srate = stream.info.effective_srate;
else
srate = raw.srate;
end
for s=1:length(streams)
if (strcmp(streams{s}.info.type,'Markers') || strcmp(streams{s}.info.type,'Events')) && ~ismember(streams{s}.info.name,args.exclude_markerstreams)
try
if iscell(streams{s}.time_series)
for e=1:length(streams{s}.time_stamps)
event(end+1).type = streams{s}.time_series{e};
event(end).latency = 1+raw.srate*(streams{s}.time_stamps(e)-stream.time_stamps(1));
event(end).latency = 1+srate*(streams{s}.time_stamps(e)-stream.time_stamps(1));
event(end).duration = 1;
end
else
for e=1:length(streams{s}.time_stamps)
event(end+1).type = num2str(streams{s}.time_series(e));
event(end).latency = 1+raw.srate*(streams{s}.time_stamps(e)-stream.time_stamps(1));
event(end).latency = 1+srate*(streams{s}.time_stamps(e)-stream.time_stamps(1));
event(end).duration = 1;
end
end
Expand All @@ -131,6 +136,7 @@
end
raw.event = event;


% etc...
raw.etc.desc = stream.info.desc;
raw.etc.info = rmfield(stream.info,'desc');
Expand Down
2 changes: 1 addition & 1 deletion Matlab/eegplugin_xdfimport.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

function vers = eegplugin_xdfimport(fig, trystrs, catchstrs)

vers = 'xdfimport1.11b';
vers = 'xdfimport1.12';

if nargin < 3
error('eegplugin_xdfimport requires 3 arguments');
Expand Down
5 changes: 3 additions & 2 deletions Matlab/xdf/load_xdf.m
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@
% Contains portions of xml2struct Copyright (c) 2010, Wouter Falkena,
% ASTI, TUDelft, 21-08-2010
%
% version 1.11
LIBVERSION = '1.11';
% version 1.12
LIBVERSION = '1.12';

% check inputs
opts = cell2struct(varargin(2:2:end),varargin(1:2:end),2);
Expand Down Expand Up @@ -227,6 +227,7 @@
end
end


% ======================
% === parse the file ===
% ======================
Expand Down

0 comments on commit d5f9229

Please sign in to comment.