[Mne_analysis] How to transfer the subjects’ heads into the same position?

Hakonen Maria maria.hakonen at aalto.fi
Wed Oct 3 00:54:40 EDT 2018
Search archives:

        External Email - Use Caution        

Thanks a lot!

Best,
Maria
________________________________________
Lähettäjä: mne_analysis-bounces at nmr.mgh.harvard.edu <mne_analysis-bounces at nmr.mgh.harvard.edu> käyttäjän Alexandre Gramfort <alexandre.gramfort at inria.fr> puolesta
Lähetetty: 30. syyskuuta 2018 21:57:18
Vastaanottaja: Discussion and support forum for the users of MNE Software
Aihe: Re: [Mne_analysis]        How to transfer the subjects’ heads into the same position?

        External Email - Use Caution

hi Maria,

the following code snippet is fully tested but it should do in theory
do what you want.
It maps an evoked object to a new set of sensor locations:

---

def remap_evoked(evoked, info_to, mode='fast'):
    # get info that should only differ in dev_head transform
    from mne import pick_types, pick_info
    from mne.forward import _map_meg_channels
    picks = pick_types(evoked.info, meg=True, eeg=False, ref_meg=True)

    info_from = pick_info(evoked.info, picks)
    info_to = pick_info(info_to, picks)
    mapping = _map_meg_channels(info_from, info_to, mode=mode)

    evoked.copy()
    evoked.info = info_to  # update info
    evoked.data[picks] = np.dot(mapping, evoked.data[picks])

    return evoked

---

let's see if someone has the time to make it a proper MNE function.

HTH
Alex

_______________________________________________
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