[Mne_analysis] trying to use ica.plot_overlay

Alexandre Gramfort alexandre.gramfort at inria.fr
Tue Oct 3 04:15:19 EDT 2017
Search archives:

hi Megan,

can you try with:

ica.plot_sources(epoch_avg, exclude=[35])


exclude should be in an int not a string.


Alex



On Tue, Oct 3, 2017 at 12:55 AM, Megan Schendel <mschendel at mrn.org> wrote:

> Hi all,
> I'm having trouble following the tutorial for Artifact Correction with ICA.
> http://martinos.org/mne/stable/auto_tutorials/plot_
> artifacts_correction_ica.html?highlight=ica%20fit
>
> I have epoched data where my artifact is timed to the event; I'm not
> investigating EOG artifact.  I am able to use ica.plot_properties and
> ica.plot_sources fine.  But when I try to do ica.plot_overlay, it looks
> like it's not excluding my bad component.  Since artifact is timed to
> event, average is just the averaged epochs.
>
> Attached: images from ica.plot_properties, ica.plot_sources, and
> ica.plot_overlay.  I'm not exactly clear on what picks and exclude expects
> (list, array, int?).
>
> Commands used are below.
> Thanks very much for any help!
>
> Megan
>
> random_state = 23
> n_components =50  # if float, select n_components by explained variance of PCA
> method = 'fastica'  # for comparison with EEGLAB try "extended-infomax" here
> decim = 3  # we need sufficient statistics, not all time points -> saves time
> reject=None # artifact is rather large, so don't want to reject it...
>
> ica = ICA(n_components=n_components, method=method, random_state=random_state)
> ica.fit(epochs, picks=picks_meg, decim=decim, reject=reject)
>
> ica.plot_sources(epochs)
>
> epoch_avg= epochs.average()
>
> ica.plot_sources(epoch_avg, exclude=['35'])
>
> ica.plot_properties(epochs, picks=35, psd_args={'fmax': 35.},
>                     image_args={'sigma': 1.})
>
>
> # Following lines included with input and output:
>
> In [72]: ica.plot_overlay(epoch_avg, exclude=['35'], show=False)
> Transforming to ICA space (50 components)
> /export/research/analysis/human/jstephen/shared/programs/python/anaconda3/lib/python3.5/site-packages/numpy/lib/arraysetops.py:375: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
>   mask &= (ar1 != a)
> Zeroing out 0 ICA components
> Out[72]: <matplotlib.figure.Figure at 0x7f8c469d55c0>
>
>
> In [74]: mne.__version__
> Out[74]: '0.14.dev0'
>
>
> MEG Technician
> The Mind Research Network
> 1101 Yale Blvd. NE
> Albuquerque, New Mexico 87106
>
>
> _______________________________________________
> 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.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20171003/4fe3bc5c/attachment.html 


More information about the Mne_analysis mailing list