[Mne_analysis] ica.apply for MEG and EEG
ak798 at cam.ac.uk
Thu Dec 15 05:09:05 EST 2016
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.
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!
> On Wed, Dec 14, 2016 at 7:45 PM A. Klimovich-Smith <ak798 at cam.ac.uk>
>> 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'
>> 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,
>> 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
>> whole raw object? Presumably, since I identify components from meg
>> first, I want to apply ica to meg data only? But ica.apply doesn't
>> 'picks' function. The two functions that perform signal
>> (_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
>> instance. Yet the resulting raw_meg_icaed object still has original
>> data and I can pick and ICA it subsequently. I can't figure out how
>> knows to keep it in. Clearly I am missing something here.
>> Thanks a lot for your help,
>> 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.
>  http://raw_meg_iced.info
>  https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>  http://www.partners.org/complianceline
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> 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
> 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
> dispose of the e-mail.
More information about the Mne_analysis