[Mne_analysis] hcp-mne head_mri trans
Denis A. Engemann
denis-alexander.engemann at inria.fr
Fri Jan 11 11:45:38 EST 2019
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
> On 11 Jan 2019, at 17:38, Maximilien Chaumon <maximilien.chaumon at gmail.com> wrote:
>
> 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'))
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190111/0c46a229/attachment.html
More information about the Mne_analysis
mailing list