[Mne_analysis] ica.apply for MEG and EEG

A. Klimovich-Smith ak798 at cam.ac.uk
Wed Dec 14 13:43:49 EST 2016
Search archives:

Dear mne python users,

I am trying to take out eog artifacts using mne python artifact 
correction with ICA. I do ICA on raw data that has both EEG and MEG 
data. I first pick MEG ch., do ICA on them (ica.fit where 'picks' has 
meg only) and find components to reject. Then I want to apply ICA 
solution to the MEG part of data and move onto EEG.

I am doing it like so:

raw_meg_iced=ica.apply(raw, exclude=some_components) #some_components = 
artifact components

picks_eeg=mne.pick_types(raw_meg_iced.info, meg=False, eeg=True, 
eog=False, stim=False, exclude='bads')

ica.fit(raw_meg_iced, picks=picks_eeg) # and so on ...

I was wondering if I am doing the right thing by doing ica.apply on the 
whole raw object? Presumably, since I identify components from meg data 
first, I want to apply ica to meg data only? But ica.apply doesn't have 
'picks' function. The two functions that perform signal reconstruction 
(_apply_raw and _pick_sources) seem to reconstruct the data from the pca 
components derived from what was ica-ed - i.e the meg data in the first 
instance. Yet the resulting raw_meg_icaed object still has original EEG 
data and I can pick and ICA it subsequently. I can't figure out how it 
knows to keep it in. Clearly I am missing something here.

Thanks a lot for your help,

More information about the Mne_analysis mailing list