[Mne_analysis] Grand average over subjects when bad channels are excluded?

Denis-Alexander Engemann denis.engemann at gmail.com
Mon Nov 17 03:34:28 EST 2014
Search archives:

Hi Maria,

we also have  mne.equalize_channels

which equlizes the channeld of a list of raw/ epochs/ or evoked object.

Denis


2014-11-17 9:21 GMT+01:00 Alexandre Gramfort <
alexandre.gramfort at telecom-paristech.fr>:

> hi Maria,
>
> your best option is to do a first for loop to get the list of all
> channels to drop,
> then drop them with evoked.drop_channels and then average.
>
> also pay attention to the number of epochs if it varies, as the + operator
> uses it.
>
> any volunteer to add a mne.evoked.grand_average function?
>
> HTH
> Alex
>
>
> On Mon, Nov 17, 2014 at 8:59 AM, Maria Hakonen <maria.hakonen at gmail.com>
> wrote:
> > Hi all,
> >
> > I have computed grand average over subjects as follows:
> >
> > for subject in subjects:
> >                 evoked = mne.read_evokeds(filename, baseline=(None, 0),
> > proj=True,verbose=False)
> >                 if flag == 1:
> >                         evoked_all = evoked[0]
> >                         flag = 0
> >                 else:
> >                         evoked_all = evoked_all+evoked[0]
> >         evoked_all = evoked_all / len(subjects)
> >
> > However, a problem arises when the evoked files don't contain the same
> > channels (this is because I have excluded bad channels and they are not
> same
> > in all files):
> >
> > AssertionError: <Evoked  |  comment : 'Unknown', time : [-0.099994,
> > 2.999808], n_epochs : 147, n_channels x n_times : 305 x 3721> and
> <Evoked  |
> > comment : 'Unknown', time : [-0.099994, 2.999808], n_epochs : 154,
> > n_channels x n_times : 306 x 3721> do not contain the same channels
> >
> > I wonder if there is any way to get the grand average over subjects if
> bad
> > channels are excluded?
> >
> > Many thanks already in advance!
> >
> > Regards,
> > Maria
> >
> >
> > _______________________________________________
> > 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.
> >
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20141117/ed67fb9e/attachment.html 


More information about the Mne_analysis mailing list