[Mne_analysis] Grand average of evoked files?

Mainak Jas mainakjas at gmail.com
Thu Sep 11 07:56:45 EDT 2014
Search archives:

Hi Maria,

I think you should make use of "evoked arithmetic". Simply doing

grand_ave = evoked1 + evoked2 + evoked3

should work. It takes into account the number of epochs while averaging.

Mainak

On Thu, Sep 11, 2014 at 2:47 PM, Maria Hakonen <maria.hakonen at gmail.com>
wrote:

> Hi all,
>
> I would like to compute a grand average of evoked files.
>
> It seems to work as: grand_ave = np.mean([evoked1.data, evoked2.data,
> evoked3.data],1)
>
> However, the problem is that if the evoked data is saved as:
>
> evoked.save("filename-ave.fif")
>
> and loaded as:
>
> evoked = mne.read_evokeds("filename-ave.fif")
>
> evoked doesn't have attribute data.
>
> I also tried:
> grand_ave = np.mean([evoked1, evoked2, evoked3],1)
>
> but this gives an error:
>
> TypeError                                 Traceback (most recent call last)
> /scratch/braindata/mhhakone/intell/<ipython-input-65-f6e26a212f6a> in
> <module>()
> ----> 1 grand_ave = np.mean([evoked1, evoked2, evoked3],1)
>
> /usr/lib/python2.7/dist-packages/numpy/core/fromnumeric.pyc in mean(a,
> axis, dtype, out)
>    2371         mean = a.mean
>    2372     except AttributeError:
> -> 2373         return _wrapit(a, 'mean', axis, dtype, out)
>    2374     return mean(axis, dtype, out)
>    2375
>
> /usr/lib/python2.7/dist-packages/numpy/core/fromnumeric.pyc in
> _wrapit(obj, method, *args, **kwds)
>      35     except AttributeError:
>      36         wrap = None
> ---> 37     result = getattr(asarray(obj),method)(*args, **kwds)
>      38     if wrap:
>      39         if not isinstance(result, mu.ndarray):
>
> TypeError: unsupported operand type(s) for /: 'Evoked' and 'float'
>
>
>
> How can I get data from -ave.fif files? (The -ave.fif files I have saved
> seems to open correctly in xFit, Matlab and mne_analyze.)
> Or is there some better way to calculate the grand average of -ave.fif
> files?
>
> 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.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20140911/57b28ae6/attachment.html 


More information about the Mne_analysis mailing list