Authored by Viateur Tuyisenge

Some bug in badchannels

... ... @@ -82,12 +82,17 @@ end
% Predict new dataset
channelClass = trainedClassifier.predictFcn(T(:,2:8));
% Get list of detected bad channels
bIdx = find(strcmp(channelClass, 'Bad'));
bIdx = T.noIdx(strcmp(channelClass, 'Bad'));
%%
% In case disconnected electrode doesn't have stimulation artefact
% specific for some FTRACT dataset
chanLbs = upper(char(D.chanlabels));
chanLbs = D.chanlabels;
try
chanLbs = upper(char(chanLbs));
catch
chanLbs = upper(char(vertcat(chanLbs{1,:})));
end
chanLbs = strrep(cellstr(chanLbs),'''','p');
crFname = D.fname;
crFname = strrep(crFname,'welectrodes_','');
... ... @@ -130,7 +135,8 @@ end
badFile = fopen(fullfile(badDir, [FileOut, '_bIdx.txt']), 'w');
fprintf(badFile, '%d\n', bIdx(:));
fclose(badFile);
channelClass(bIdx) = {'Bad'};
Lia = ismember(T.noIdx,bIdx);
channelClass(Lia) = {'Bad'};
Tnew = [T channelClass];
Tnew.Properties.VariableNames{'Var9'} = 'Note';
csvfilename = fullfile(badDir, [FileOut, '.csv']); % Save feature table & badchannels indices
... ...
... ... @@ -68,7 +68,7 @@ nx = size(sens,2);
nn = 10;
nt = find((time(D)>= -0.5));
ny = D.nsamples;
data= D(1:nx,nt(1):ny);
data= D(sens,nt(1):ny);
logScale = 1;
%%
rawVar = var(data, [], 2); % Compute raw data variance
... ... @@ -109,7 +109,7 @@ for i = 1:nx
end
ch_xcorr(i) = ch_xcorr(i) + abs(thisCorr);
end
noIdx(i) = i;
noIdx(i) = sens(i);
ch_xcorr(i) = ch_xcorr(i)/numel(idx);
end
... ...