[Mne_analysis] Standard montages and coordinate systems

Christopher Bailey cjb at cfin.au.dk
Mon Nov 27 09:12:27 EST 2017
Search archives:

Hi Laura,

Are you sure you want to use the `sample` subject as your anatomy? If you’re aiming at some sort of ‘template brain’ source localisation approach, would something like the ‘fsaverage’ brain be more appropriate?

The problem is that the transformation you load is between sample’s fiducial head coordinates and sample’s MRI. The default montage you load is however not in sample’s head frame, so your coreg is off.

For the fsaverage-approach, something like the following might work. NB: there’s a small bug that’s being fixed on github (see [1]). You can either wait until it’s in master, or check out the fix yourself.

[1](https://github.com/mne-tools/mne-python/issues/4783)

/Chris

subject = 'fsaverage'
subjects_dir = '/Users/cjb/tmp/subs_dir’  # change appropriately
mne.create_default_subject(subjects_dir=subjects_dir)

montage_1005 = mne.channels.read_montage(kind='standard_1005')
fake_info = mne.create_info(ch_names=montage_1005.ch_names, sfreq=1000, ch_types='eeg', montage=montage_1005)

# need to write a file to load into coregistration, not possible to pass info directly
fake_raw = mne.io.RawArray(np.zeros((len(fake_info['ch_names']), 1)), fake_info)
fake_raw.save('fake_raw.fif', overwrite=True)

# coregister and save trans
mne.gui.coregistration(inst='fake_raw.fif', subject=subject, subjects_dir=subjects_dir)

trans = _path_to_saved_trans.fif_

# set src=None, or calculate a source space, e.g.
# src = mne.setup_source_space(subject, subjects_dir=subjects_dir,
                               spacing='oct5’)

mne.viz.plot_alignment(info=fake_info, trans=trans, subject=subject, dig=True,
                       meg=False, src=None, subjects_dir=subjects_dir)




On 26 Nov 2017, at 13.05, Laura Novelinkova <l.novelinkova at gmail.com<mailto:l.novelinkova at gmail.com>> wrote:

Hello,

I am trying to create an EEG forward model using

  1.  anatomy from the sample dataset
  2.  source space from sample_audvis-meg-oct-6-meg-inv.fif
  3.  standard 1005 montage

When I check the consistency of the coordinate systems with plot_alignment, I see that the electrode locations are off.

I think that I need to add transformation information to the info I make based off the standard montage. Am I right? If yes, could you please advise me what transformation should I use? And if no, what should I do instead?

Any help will be greatly appreciated.

Sincerely, Laura Novelinkova

Additional info: I am on Windows 7, Python version is 2.7, mne version is 15, I run the code in iPython console. Below is my current code and the output of plot_alignment:

from mayavi import mlab  # without this the windows show nothing and hang python
import mne
from mne.datasets import sample
import os

%gui qt

subject = 'sample'
data_path = sample.data_path()
inverse_operator_file_path = os.path.join(data_path, 'MEG', 'sample', 'sample_audvis-meg-oct-6-meg-inv.fif')
subjects_dir = os.path.join(data_path, 'subjects')

montage_1005 = mne.channels.read_montage(kind='standard_1005')
fake_info = mne.create_info(ch_names=montage_1005.ch_names, sfreq=1000, ch_types='eeg', montage=montage_1005)
trans = os.path.join(data_path, 'MEG', 'sample', 'sample_audvis_raw-trans.fif')
source_space = mne.read_source_spaces(inverse_operator_file_path)


mne.viz.plot_alignment(info=fake_info, trans=trans, subject=subject, dig=True,
                       meg=False, src=source_space, subjects_dir=subjects_dir)


<misaligned_electrodes.png>

[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>    Virus-free. www.avast.com<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
<x-msg://30/#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu<mailto: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/20171127/179336a1/attachment-0001.html 


More information about the Mne_analysis mailing list