Authored by Anthony Boyer

Now removing underscores from channel labels in .mat files.

... ... @@ -133,7 +133,7 @@ for i0 = 1:size(t,1)
% Loop on all channels available in the file
for i1 = 1:length(Sensors.label)
sensLtmp = Sensors.label{i1};
sensLtmp(ismember(double(sensLtmp),[',' ';' '-'])) ='';
sensLtmp(ismember(double(sensLtmp),[',' ';' '-' '_'])) ='';
Sensors.label{i1} = sensLtmp;
iChanPos = findChannel(Sensors.label{i1}, Name, 'all_upper');
% If the channel was already found in the list before: check the best option based on the case
... ... @@ -225,7 +225,7 @@ for i0 = 1:size(t,1)
% Replace labels in D.channels
for iChan = 1:length(SpmMat.D.channels)
spmLtmp = SpmMat.D.channels(iChan).label;
spmLtmp(ismember(double(spmLtmp),[',' ';' '-'])) ='';
spmLtmp(ismember(double(spmLtmp),[',' ';' '-' '_'])) ='';
SpmMat.D.channels(iChan).label = spmLtmp;
iChanMatch = find(strcmpi(SpmMat.D.channels(iChan).label, chMatchLog(:,1)));
... ... @@ -311,6 +311,9 @@ for i0 = 1:size(t,1)
SpmMat.D.trials.events(iEvt).type = noteNameNew;
end
end
if ~(exist('csv_all_electrodes','var') == 1)
error('Could not match notes with channels found in the implantation file.')
end
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
... ...