How to transfer the subjects’ heads into the same position?

External Email - Use Caution

Dear MNE experts,

Could you please let me know if it is possible to transfer all subjects?
heads into the same position (i.e destination option) using Maxwell filter
without filtering the data? Or is there some other tool that I should use
to transfer the subjects? heads into the same position?

I already tried:
data=mne.preprocessing.maxwell_filter(raw,st_only=True,st_duration=None,destination=(0,
0, 0.04));

... but got:
ValueError: st_duration must not be None if st_only is True

Thanks a lot already in advance!

Best,
Maria
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180927/537716e3/attachment.html

External Email - Use Caution

Could you please let me know if it is possible to transfer all subjects?
heads into the same position (i.e destination option) using Maxwell filter
without filtering the data?

Currently to do this the data must be projected onto the multipole moments
and then back out to the sensors at the new virtual position. So the
filtering is implicitly required.

Or is there some other tool that I should use to transfer the subjects?

heads into the same position?

In MNE we have implemented minimum-norm based transformations but I don't
think there is a simple publicly available API. Feel free to open an issue
there and we can settle on one and implement it.

Best,
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180927/593782e8/attachment.html

External Email - Use Caution

Thank you for the answer!

Best,
Maria

to 27. syysk. 2018 klo 22.54 Eric Larson (larson.eric.d at gmail.com)
kirjoitti:

        External Email - Use Caution

Could you please let me know if it is possible to transfer all subjects?

heads into the same position (i.e destination option) using Maxwell filter
without filtering the data?

Currently to do this the data must be projected onto the multipole moments
and then back out to the sensors at the new virtual position. So the
filtering is implicitly required.

Or is there some other tool that I should use to transfer the subjects?

heads into the same position?

In MNE we have implemented minimum-norm based transformations but I don't
think there is a simple publicly available API. Feel free to open an issue
there and we can settle on one and implement it.

Best,
Eric

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180929/069e7320/attachment.html

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:

External Email - Use Caution

Thanks a lot!

Best,
Maria

External Email - Use Caution

Hi all,

I would like to transfer all subjects? heads into the same position.
I have calculated an average head position across subjects, created a
transformation matrix and saved it as a trans.fif file (i.e. this is what
can be given as 'destination' in Maxwell Filter):
<Transform | MEG device->head>
[[ 1. 0. 0. 0. ]
[ 0. 1. 0. -0.04299995]
[ 0. 0. 1. 0.0547426 ]
[ 0. 0. 0. 1. ]]

Could someone please let me know how this information could be given in the
code Alex sent me in the previous mail of this discussion?

Here is yet the code:

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

Best,
Maria

ke 3. lokak. 2018 klo 7.55 Hakonen Maria (maria.hakonen at aalto.fi) kirjoitti:

        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
Mne_analysis Info Page

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20181124/9f7ecece/attachment.html

External Email - Use Caution

hi Maria,

just insert:

info_to['dev_head_t'] = your_transform

before the call to _map_meg_channels

I assume the transform you pasted is called your_transform

HTH
Alex

External Email - Use Caution

Thank you!
I will try this!

Best,
Maria