[Mne_analysis] ica.apply for MEG and EEG

A. Klimovich-Smith ak798 at cam.ac.uk
Thu Dec 15 05:09:05 EST 2016
Search archives:

Hi Denis,

Thanks for replying. Yes, I couldn't find an example of MEG and EEG 
sequential ICA workflow on the website and it would be very useful.

Do I conclude correctly then, from what you said, that my approach (the 
lines of code I forwarded) is correct? I guess I can save some space by 
not creating a new object (raw_meg_iced=ica.apply(raw, 
exclude=some_components)) and continue EEG ica directly on raw as you 
suggest. But both should do the same thing.

Thanks again,
Ana


On 2016-12-14 19:05, Denis-Alexander Engemann wrote:
> Hi Ana,
> 
> ICA should be smart enough to figure out which channels it applies to.
> The important thing is that you fit it twice, cone for MEG and once
> for EEG.
> The workflow then is to apply them sequentially to your raw object.
> I am not sure if we have an example that shows this.
> We'll check that and add it if it doesn't exist.
> Thanks for bringing this up!
> 
> Denis
> 
> On Wed, Dec 14, 2016 at 7:45 PM A. Klimovich-Smith <ak798 at cam.ac.uk>
> wrote:
> 
>> 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 [1], 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,
>> Ana
>> 
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis [2]
>> 
>> The information in this e-mail is intended only for the person to
>> whom it is
>> addressed. If you believe this e-mail was sent to you in error and
>> the e-mail
>> contains patient information, please contact the Partners
>> Compliance HelpLine at
>> http://www.partners.org/complianceline [3] . If the e-mail was sent
>> to you in error
>> but does not contain patient information, please contact the sender
>> and properly
>> dispose of the e-mail.
> 
> 
> Links:
> ------
> [1] http://raw_meg_iced.info
> [2] https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
> [3] http://www.partners.org/complianceline
> 
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
> 
> 
> The information in this e-mail is intended only for the person to whom 
> it is
> addressed. If you believe this e-mail was sent to you in error and the 
> e-mail
> contains patient information, please contact the Partners Compliance 
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you 
> in error
> but does not contain patient information, please contact the sender and 
> properly
> dispose of the e-mail.



More information about the Mne_analysis mailing list