Commit 705205e0 authored by Tyler Collins's avatar Tyler Collins
Browse files

Adding tutorial configuration back in.

parent 47c3f63a
function eeg_init(inbdffiles,outsetfile)
%loop through inbdffiles
for i=1:length(inbdffiles);
%import bdf file
ALLEEG(i) = pop_biosig(inbdffiles{i}, 'channels', 1:128 );
%resample to 512
ALLEEG(i) = pop_resample( ALLEEG(i), 512);
end
%merge files
EEG = pop_mergeset( ALLEEG, 1:length(ALLEEG), 0);
%load average BUCANL BioSemi head channel coordinates
EEG=pop_chanedit(EEG, 'load',{'sourcedata/misc/BioSemi_BUCANL_EEGLAB.sfp' 'filetype' 'autodetect'});
%rename events
for i=1:length(EEG.event);
if isnumeric(EEG.event(i).type);
EEG.event(i).type=num2str(EEG.event(i).type);
end
if strcmp(EEG.event(i).type,'11');
EEG.event(i).type='house-upright-f1';
elseif strcmp(EEG.event(i).type,'12');
EEG.event(i).type='house-upright-f2';
elseif strcmp(EEG.event(i).type,'13');
EEG.event(i).type='house-upright-f3';
elseif strcmp(EEG.event(i).type,'14');
EEG.event(i).type='house-upright-f4';
elseif strcmp(EEG.event(i).type,'15');
EEG.event(i).type='house-upright-f5';
elseif strcmp(EEG.event(i).type,'16');
EEG.event(i).type='house-upright-f6';
elseif strcmp(EEG.event(i).type,'21');
EEG.event(i).type='house-inverted-f1';
elseif strcmp(EEG.event(i).type,'22');
EEG.event(i).type='house-inverted-f2';
elseif strcmp(EEG.event(i).type,'23');
EEG.event(i).type='house-inverted-f3';
elseif strcmp(EEG.event(i).type,'24');
EEG.event(i).type='house-inverted-f4';
elseif strcmp(EEG.event(i).type,'25');
EEG.event(i).type='house-inverted-f5';
elseif strcmp(EEG.event(i).type,'26');
EEG.event(i).type='house-inverted-f6';
elseif strcmp(EEG.event(i).type,'31');
EEG.event(i).type='face-upright-f1';
elseif strcmp(EEG.event(i).type,'32');
EEG.event(i).type='face-upright-f2';
elseif strcmp(EEG.event(i).type,'33');
EEG.event(i).type='face-upright-f3';
elseif strcmp(EEG.event(i).type,'34');
EEG.event(i).type='face-upright-f4';
elseif strcmp(EEG.event(i).type,'35');
EEG.event(i).type='face-upright-f5';
elseif strcmp(EEG.event(i).type,'36');
EEG.event(i).type='face-upright-f6';
elseif strcmp(EEG.event(i).type,'41');
EEG.event(i).type='face-inverted-f1';
elseif strcmp(EEG.event(i).type,'42');
EEG.event(i).type='face-inverted-f2';
elseif strcmp(EEG.event(i).type,'43');
EEG.event(i).type='face-inverted-f3';
elseif strcmp(EEG.event(i).type,'44');
EEG.event(i).type='face-inverted-f4';
elseif strcmp(EEG.event(i).type,'45');
EEG.event(i).type='face-inverted-f5';
elseif strcmp(EEG.event(i).type,'46');
EEG.event(i).type='face-inverted-f6';
elseif strcmp(EEG.event(i).type,'51');
EEG.event(i).type='checker-f1';
elseif strcmp(EEG.event(i).type,'52');
EEG.event(i).type='checker-f2';
elseif strcmp(EEG.event(i).type,'53');
EEG.event(i).type='checker-f3';
elseif strcmp(EEG.event(i).type,'54');
EEG.event(i).type='checker-f4';
elseif strcmp(EEG.event(i).type,'55');
EEG.event(i).type='checker-f5';
elseif strcmp(EEG.event(i).type,'56');
EEG.event(i).type='checker-f6';
elseif strcmp(EEG.event(i).type,'211');
EEG.event(i).type='face-upright';
elseif strcmp(EEG.event(i).type,'212');
EEG.event(i).type='face-inverted';
elseif strcmp(EEG.event(i).type,'213');
EEG.event(i).type='house-upright';
elseif strcmp(EEG.event(i).type,'214');
EEG.event(i).type='house-inverted';
elseif strcmp(EEG.event(i).type,'215');
EEG.event(i).type='checker-left';
elseif strcmp(EEG.event(i).type,'216');
EEG.event(i).type='checker-right';
elseif strcmp(EEG.event(i).type,'201');
EEG.event(i).type='press-left';
elseif strcmp(EEG.event(i).type,'204');
EEG.event(i).type='press-right';
elseif strcmp(EEG.event(i).type,'boundary');
EEG.event(i).duration=0;
else
EEG.event(i).type=['e-',num2str(EEG.event(i).type)];
end
end
%save output set file
EEG = pop_saveset( EEG, 'filename',outsetfile);
diary 'sourcedata/eeg/sub-s01.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s01/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P01_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P01_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P01_f_3.bdf', ...
'sourcedata/eeg/IC_trn_P01_f_4.bdf', ...
'sourcedata/eeg/IC_trn_P01_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P01_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P01_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P01_O_4.bdf'}, ...
'sub-s01/eeg/sub-s01_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s02.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s02/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P02_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P02_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P02_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P02_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P02_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P02_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P02_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P02_O_4.bdf'}, ...
'sub-s02/eeg/sub-s02_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s03.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s03/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P03_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P03_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P03_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P03_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P03_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P03_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P03_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P03_O_4.bdf'}, ...
'sub-s03/eeg/sub-s03_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s04.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s04/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P04_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P04_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P04_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P04_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P04_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P04_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P04_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P04_O_4.bdf'}, ...
'sub-s04/eeg/sub-s04_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s05.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s05/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P05_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P05_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P05_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P05_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P05_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P05_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P05_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P05_O_4.bdf'}, ...
'sub-s05/eeg/sub-s05_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s06.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s06/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P06_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P06_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P06_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P06_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P06_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P06_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P06_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P06_O_4.bdf'}, ...
'sub-s06/eeg/sub-s06_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s07.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s07/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P07_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P07_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P07_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P07_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P07_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P07_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P07_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P07_O_4.bdf'}, ...
'sub-s07/eeg/sub-s07_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s08.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s08/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P08_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P08_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P08_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P08_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P08_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P08_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P08_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P08_O_4.bdf'}, ...
'sub-s08/eeg/sub-s08_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s09.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s09/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P09_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P09_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P09_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P09_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P09_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P09_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P09_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P09_O_4.bdf'}, ...
'sub-s09/eeg/sub-s09_task-faceFO_eeg.set');
diary 'sourcedata/eeg/sub-s10.log';
%% CHECK FOR OUTPUT PATH AND CRETAE IF NECESSARY
system('mkdir -p sub-s10/eeg');
eeg_init({'sourcedata/eeg/IC_trn_P10_F_1.bdf', ...
'sourcedata/eeg/IC_trn_P10_F_2.bdf', ...
'sourcedata/eeg/IC_trn_P10_F_3.bdf', ...
'sourcedata/eeg/IC_trn_P10_F_4.bdf', ...
'sourcedata/eeg/IC_trn_P10_O_1.bdf', ...
'sourcedata/eeg/IC_trn_P10_O_2.bdf', ...
'sourcedata/eeg/IC_trn_P10_O_3.bdf', ...
'sourcedata/eeg/IC_trn_P10_O_4.bdf'}, ...
'sub-s10/eeg/sub-s10_task-faceFO_eeg.set');
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment