hcp-mne head_mri trans

External Email - Use Caution

Hello,

I'm starting to play around with mne-hcp
I'm picking code in the examples of mne-hcp to create in each subjec:
mne_anatomy. fine
bem_model and _solution. fine
head_mri_t. fine
check that everything is in place with mne.viz.plot_alignment, and I get
this:
https://drive.google.com/open?id=17altWLQIfyZMxUcvnsxgzJp9zN0qcET0
I understand that the head_mri_t is not applied to the helmet. is that
correct? how impactfull is that for upcoming computations? how can I fix it?

Many thanks,
Max

This is my code:

import os.path as op
import glob
import mne
import hcp

storage_dir =
op.expanduser('~/owncloud/Lab/Projects/SOLID_MEEG/data/HCPunzipped')
subjects_dir =
op.expanduser('~/owncloud/Lab/Projects/SOLID_MEEG/data/HCPsubjects')
recordings_dir =
op.expanduser('~/owncloud/Lab/Projects/SOLID_MEEG/data/HCPmeg')

subjects = glob.glob(op.join(storage_dir,'[0-9][0-9][0-9][0-9][0-9][0-9]'))

src_fsaverage = mne.setup_source_space(
    subject='fsaverage',
subjects_dir='/network/lustre/iss01/cenir/software/meeg/freesurfer/subjects',
add_dist=False,
    spacing='oct6')

for subject in subjects:
    hcp_params = dict(
        hcp_path=storage_dir,
        subject=subject,
        data_type='rest')

    run_index = 0

    hcp.make_mne_anatomy(
        subject, subjects_dir = subjects_dir,
        hcp_path = storage_dir,
        recordings_path = recordings_dir)

    bems = mne.make_bem_model(subject, conductivity=(0.3,),
                              subjects_dir=subjects_dir,
                              ico=None) # ico = None for morphed SP.

mne.write_bem_surfaces(op.join(subjects_dir,subject,'bem',subject+'-bem.fif'),bems)

    bem_sol = mne.make_bem_solution(bems)
    bem_sol['surfs'][0]['coord_frame'] = 5

mne.write_bem_solution(op.join(subjects_dir,subject,'bem',subject+'-bem-sol.fif'),bem_sol)

    head_mri_t = mne.read_trans(
        op.join(recordings_dir, subject,
'{}-head_mri-trans.fif'.format(subject)))

mne.write_trans(op.join(subjects_dir,subject,'bem',subject+'-trans.fif'),head_mri_t)

    info = hcp.read_info(run_index=run_index, **hcp_params)
    picks = mne.pick_types(info, meg=True, ref_meg=False)
    info = mne.pick_info(info, picks)

mne.viz.plot_alignment(info,head_mri_t,subject=subject,subjects_dir=subjects_dir,surfaces=('inner_skull','white'))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190111/4f31ab71/attachment-0001.html

External Email - Use Caution

Hey Max,

Checkout this tutorial: http://mne-tools.github.io/mne-hcp/auto_examples/plot_coregistration.html#sphx-glr-auto-examples-plot-coregistration-py

The default mne plotter does not work. You need to manage the hcp transforms differently from how mne thinks it should be done.

Let me know if it helps.

Denis

External Email - Use Caution

ok. So I assume things are just fine.
Only the device helmet, represented in blue in the figure is somehow tilted
90? off, but it's just an aesthetic thing if I understand correctly, right?

Le ven. 11 janv. 2019 ? 17:46, Denis A. Engemann <
denis-alexander.engemann at inria.fr> a ?crit :

        External Email - Use Caution

Hey Max,

Checkout this tutorial:
Read and plot coregistration — MNE-HCP 0.1.dev12 documentation

The default mne plotter does not work. You need to manage the hcp
transforms differently from how mne thinks it should be done.

Let me know if it helps.

Denis

        External Email - Use Caution

Hello,

I'm starting to play around with mne-hcp
I'm picking code in the examples of mne-hcp to create in each subjec:
mne_anatomy. fine
bem_model and _solution. fine
head_mri_t. fine
check that everything is in place with mne.viz.plot_alignment, and I get
this:
Selection_029.png - Google Drive
I understand that the head_mri_t is not applied to the helmet. is that
correct? how impactfull is that for upcoming computations? how can I fix it?

Many thanks,
Max

This is my code:

import os.path as op
import glob
import mne
import hcp

storage_dir =
op.expanduser('~/owncloud/Lab/Projects/SOLID_MEEG/data/HCPunzipped')
subjects_dir =
op.expanduser('~/owncloud/Lab/Projects/SOLID_MEEG/data/HCPsubjects')
recordings_dir =
op.expanduser('~/owncloud/Lab/Projects/SOLID_MEEG/data/HCPmeg')

subjects = glob.glob(op.join(storage_dir,'[0-9][0-9][0-9][0-9][0-9][0-9]'))

src_fsaverage = mne.setup_source_space(
    subject='fsaverage',
subjects_dir='/network/lustre/iss01/cenir/software/meeg/freesurfer/subjects',
add_dist=False,
    spacing='oct6')

for subject in subjects:
    hcp_params = dict(
        hcp_path=storage_dir,
        subject=subject,
        data_type='rest')

    run_index = 0

    hcp.make_mne_anatomy(
        subject, subjects_dir = subjects_dir,
        hcp_path = storage_dir,
        recordings_path = recordings_dir)

    bems = mne.make_bem_model(subject, conductivity=(0.3,),
                              subjects_dir=subjects_dir,
                              ico=None) # ico = None for morphed SP.

mne.write_bem_surfaces(op.join(subjects_dir,subject,'bem',subject+'-bem.fif'),bems)

    bem_sol = mne.make_bem_solution(bems)
    bem_sol['surfs'][0]['coord_frame'] = 5

mne.write_bem_solution(op.join(subjects_dir,subject,'bem',subject+'-bem-sol.fif'),bem_sol)

    head_mri_t = mne.read_trans(
        op.join(recordings_dir, subject,
'{}-head_mri-trans.fif'.format(subject)))

mne.write_trans(op.join(subjects_dir,subject,'bem',subject+'-trans.fif'),head_mri_t)

    info = hcp.read_info(run_index=run_index, **hcp_params)
    picks = mne.pick_types(info, meg=True, ref_meg=False)
    info = mne.pick_info(info, picks)

mne.viz.plot_alignment(info,head_mri_t,subject=subject,subjects_dir=subjects_dir,surfaces=('inner_skull','white'))

_______________________________________________
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/20190111/00211ec3/attachment.html

External Email - Use Caution

Yes I think I tilted the display a bit for aesthetics. Can you just try the
tutorial code for a few cases yourself to see if you get convinced?
I have been so far pretty convinced that we got the transforms right and
the source localizations look plausible.
We may want to document this better ...

Best,
Denis