Authored by Anthony Boyer

Fix for the parsing of notes for REN patients. Fix stimulation detection issue f…

…or stimulation frequency <1Hz (FRE)
... ... @@ -369,8 +369,16 @@ for c = 1:length(KeepEvent) % Navigate all stim events
xsub2 = cellstr(xsub2);
S.StimFreq = 1;
StimFreq = 1;
else
StimFreq=str2double(xsub2{1}(1:end-2));
else
% We assume a leading 0 implies a stimulation frequency <1 (e.g. 026 -> 0.26).
% Only used for the detection of stimulations (ImaGIN_StimDetect.m) Boyer.A 25/08/2020
freq_string = xsub2{1}(1:end-2);
match_freq = regexp(freq_string,'^0+(?<value>[0-9]+)$','once','names');
if ~isempty(match_freq)
StimFreq=str2double(['0.' match_freq.value]);
else
StimFreq=str2double(freq_string);
end
S.StimFreq = StimFreq;
end
xsub3 = regexp(noteName,rxp3,'match');
... ...
... ... @@ -108,7 +108,8 @@ for j=1:length(KeepEvent) % Navigate all stim events
noteName(~ismember(double(noteName),['A':'Z' 'a':'z' '_' '.' '''' 'µ' '-' '0':'9'])) ='';
noteName = regexprep(noteName,'_+','_'); noteName = regexprep(noteName,'µ','u');
if strcmpi(patientCode(5:end),'MIL');noteName = strrep(noteName,'.0',''); noteName = strrep(noteName,'_MA_','_');end%some MIL notes
noteName = strrep(noteName,'.',''); noteName = strrep(noteName,',','');
if strcmpi(patientCode(5:end),'REN');noteName = strrep(noteName,'.0','');end%some REN 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_','');
noteName = strrep(noteName,'stim',''); noteName = strrep(noteName,'Stim','');
... ...