Was reading through the PREP re-referencing code while working on PyPREP, and noticed something that looks to be a bug in updateBadChannels.m:
|
function ref = updateBadChannels(ref, noisy) |
|
% Update the bad channel lists from ref based on bad channels in noisy |
|
ref.badChannelsFromNaNs = union(ref.badChannelsFromNaNs, ... |
|
noisy.badChannelsFromNaNs); |
|
ref.badChannelsFromNoData = union(ref.badChannelsFromNoData, ... |
|
noisy.badChannelsFromNoData); |
|
ref.badChannelsFromHFNoise = union(ref.badChannelsFromHFNoise, ... |
|
noisy.badChannelsFromHFNoise); |
|
ref.badChannelsFromCorrelation = union(ref.badChannelsFromCorrelation, ... |
|
noisy.badChannelsFromCorrelation); |
|
ref.badChannelsFromDeviation = union(ref.badChannelsFromDeviation, ... |
|
noisy.badChannelsFromDeviation); |
|
ref.badChannelsFromRansac = union(ref.badChannelsFromRansac, ... |
|
noisy.badChannelsFromRansac); |
|
ref.badChannelsFromDropOuts = union(ref.badChannelsFromDropOuts, ... |
|
noisy.badChannelsFromDropOuts); |
|
ref.all = union(... |
|
union(ref.badChannelsFromNaNs, ref.badChannelsFromNoData), ... |
|
union( ... |
|
union(ref.badChannelsFromHFNoise, ref.badChannelsFromCorrelation), ... |
|
union( ... |
|
union(ref.badChannelsFromDeviation,ref.badChannelsFromRansac), ... |
|
ref.badChannelsFromRansac))); |
Specifically, dropout channels aren't included in the ref.all union at the end, meaning that they're never excluded/interpolated during re-referencing. Additionally, ref.badChannelsFromRansac is included in the union twice, which makes it look like bad-by-dropout channels were meant to be included but got copy/pasted incorrectly.
Thanks in advance for taking a look!
Was reading through the PREP re-referencing code while working on PyPREP, and noticed something that looks to be a bug in
updateBadChannels.m:EEG-Clean-Tools/PrepPipeline/utilities/updateBadChannels.m
Lines 1 to 23 in 3ed337e
Specifically, dropout channels aren't included in the
ref.allunion at the end, meaning that they're never excluded/interpolated during re-referencing. Additionally,ref.badChannelsFromRansacis included in the union twice, which makes it look like bad-by-dropout channels were meant to be included but got copy/pasted incorrectly.Thanks in advance for taking a look!