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

Mads Jensen mje.mads at gmail.com
Mon Nov 17 04:28:56 EST 2014
Search archives:

Hi all,

I can give the  mne.evoked.grand_average function a try.

best regards,
mads

On 17/11/14 09:21, Alexandre Gramfort wrote:
> 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
>



More information about the Mne_analysis mailing list