% Script to add HED tags to data
% Authors: Dung Truong, SCCN 2020

path2data = '../../bids_p3_2subjects/';
fMap = '/Volumes/projects/BIDSfiles/P3/bids_p3_2subjects/matlab/fMap.mat';

% subject 1
filepath = fullfile(path2data, 's01raw', 's01.set');
EEG = pop_loadset(filepath);
EEG = pop_tageeg(EEG, 'UseGui', false, 'BaseMap', fMap);
pop_saveset(EEG, 'filename', 's01_tagged.set', 'filepath', fullfile(path2data, 's01raw'));

% subject 2
filepath = fullfile(path2data, 's02raw', 's02.set');
EEG = pop_loadset(filepath);
EEG = pop_tageeg(EEG, 'UseGui', false, 'BaseMap', fMap);
pop_saveset(EEG, 'filename', 's02_tagged.set', 'filepath', fullfile(path2data, 's02raw'));