<div dir="ltr">Hi all,<div><br></div><div>Many thanks for all help!</div><div>I will try mne.evoked.grand_average.</div><div>Can I find it if I first get the latest code as: git clone git://<a href="http://github.com/mne-tools/mne-python.git">github.com/mne-tools/mne-python.git</a><br></div><div>and then simply type <span style="font-family:arial,sans-serif;font-size:13px">mne.evoked.grand_average ? in python?</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><font face="arial, sans-serif">Regards,</font></div><div><font face="arial, sans-serif">Maria</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-11-17 11:28 GMT+02:00 Mads Jensen <span dir="ltr"><<a href="mailto:mje.mads@gmail.com" target="_blank">mje.mads@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I can give the mne.evoked.grand_average function a try.<br>
<br>
best regards,<br>
mads<br>
<div class="HOEnZb"><div class="h5"><br>
On 17/11/14 09:21, Alexandre Gramfort wrote:<br>
> hi Maria,<br>
><br>
> your best option is to do a first for loop to get the list of all<br>
> channels to drop,<br>
> then drop them with evoked.drop_channels and then average.<br>
><br>
> also pay attention to the number of epochs if it varies, as the + operator<br>
> uses it.<br>
><br>
> any volunteer to add a mne.evoked.grand_average function?<br>
><br>
> HTH<br>
> Alex<br>
><br>
><br>
> On Mon, Nov 17, 2014 at 8:59 AM, Maria Hakonen <<a href="mailto:maria.hakonen@gmail.com">maria.hakonen@gmail.com</a>> wrote:<br>
>> Hi all,<br>
>><br>
>> I have computed grand average over subjects as follows:<br>
>><br>
>> for subject in subjects:<br>
>> evoked = mne.read_evokeds(filename, baseline=(None, 0),<br>
>> proj=True,verbose=False)<br>
>> if flag == 1:<br>
>> evoked_all = evoked[0]<br>
>> flag = 0<br>
>> else:<br>
>> evoked_all = evoked_all+evoked[0]<br>
>> evoked_all = evoked_all / len(subjects)<br>
>><br>
>> However, a problem arises when the evoked files don't contain the same<br>
>> channels (this is because I have excluded bad channels and they are not same<br>
>> in all files):<br>
>><br>
>> AssertionError: <Evoked | comment : 'Unknown', time : [-0.099994,<br>
>> 2.999808], n_epochs : 147, n_channels x n_times : 305 x 3721> and <Evoked |<br>
>> comment : 'Unknown', time : [-0.099994, 2.999808], n_epochs : 154,<br>
>> n_channels x n_times : 306 x 3721> do not contain the same channels<br>
>><br>
>> I wonder if there is any way to get the grand average over subjects if bad<br>
>> channels are excluded?<br>
>><br>
>> Many thanks already in advance!<br>
>><br>
>> Regards,<br>
>> Maria<br>
>><br>
>><br>
>> _______________________________________________<br>
>> Mne_analysis mailing list<br>
>> <a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.edu</a><br>
>> <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
>><br>
>><br>
>> The information in this e-mail is intended only for the person to whom it is<br>
>> addressed. If you believe this e-mail was sent to you in error and the<br>
>> e-mail<br>
>> contains patient information, please contact the Partners Compliance<br>
>> HelpLine at<br>
>> <a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in<br>
>> error<br>
>> but does not contain patient information, please contact the sender and<br>
>> properly<br>
>> dispose of the e-mail.<br>
>><br>
> _______________________________________________<br>
> Mne_analysis mailing list<br>
> <a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.edu</a><br>
> <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
><br>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
</div></div></blockquote></div><br></div>