Authored by Anthony Boyer

Fix for some GRE notes and save electrode step output as SPM object

... ... @@ -483,7 +483,7 @@ for c = 1:length(KeepEvent) % Navigate all stim events
S.FileOut= fullfile(DirOut, strcat(noteNameNew,'.txt'));
mat_file = load(sFile);
csv_chanlabels = mat_file.D.csv.chanlabels; % This new field is generated during the Electrode step so the .mat stores the channel labels found in the csv
csv_chanlabels = mat_file.D.other.csv_labels; % This new field is generated during the Electrode step so the .mat stores the channel labels found in the csv
iChanMatch1 = find(strcmpi(chLabel1, csv_chanlabels));
iChanMatch2 = find(strcmpi(chLabel2, csv_chanlabels));
... ...
... ... @@ -309,9 +309,11 @@ for i0 = 1:size(t,1)
SpmMat.D.trials.events(iEvt).type = noteNameNew;
end
end
SpmMat.D.csv.chanlabels = csv_all_electrodes(:,1); % Add an extra field to the .mat so we have a listing of all channel labels in the csv.
csv_struct.csv_labels = csv_all_electrodes(:,1);
SpmMat.D.other = csv_struct; % Add an extra field to the .mat so we have a listing of all channel labels in the csv.
% Update existing .mat file
save(SpmFile, '-struct', 'SpmMat');
save(spm_eeg_load(SpmFile)); % SPM's save to create a valid SPM object
end
end
... ...
... ... @@ -116,6 +116,7 @@ for j=1:length(KeepEvent) % Navigate all stim events
if strcmpi(patientCode(5:end),'REN');noteName = strrep(noteName,'.0','');end%some REN notes
if strcmpi(patientCode(5:end),'HUH');noteName = strrep(noteName,'.0','');end%some HUH notes
if strcmpi(patientCode(5:end),'TOU');noteName = strrep(noteName,'.0','');end%some TOU notes
if strcmpi(patientCode(5:end),'GRE');noteName = strrep(noteName,'.0','');end%some GRE notes
noteName = strrep(noteName,'.',''); noteName = strrep(noteName,',',''); % /!\ float value becomes integer /!\
noteName = strrep(noteName,'sec','s'); noteName = strrep(noteName,'AA','A');
noteName = strrep(noteName,'Stim_Start_',''); noteName = strrep(noteName,'Stim_Stop_','');
... ...