kylemath / DeepEEG

Deep Learning with Tensor Flow for EEG MNE Epoch Objects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

re-reference to linked mastoid

kylemath opened this issue · comments

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