Closed kylemath closed 5 years ago
since it is all linear, lets not, and say we did (more important for ERP comparisons across studies )
% arithmetically rereference to linked mastoid
for x=1:EEG.nbchan-2
EEG.data(x,:) = (EEG.data(x,:)-((EEG.data(EEG.nbchan-2,:))*.5));
end
fixed in #8
with new function in util.py, and call in preprocessing, and flag in preprocessing
def mastoidReref(raw):
ref_idx = pick_channels(raw.info['ch_names'],['M2'])
eeg_idx = pick_types(raw.info,eeg=True)
raw._data[eeg_idx,:] = raw._data[eeg_idx,:] - raw._data[ref_idx,:] * .5 ;
return raw
https://martinos.org/mne/stable/auto_examples/preprocessing/plot_rereference_eeg.html