Changing a sample subject's montage

Hello,
I am trying to simulate data with a sample subject’s head measurements but would prefer to use a different montage. Is there a straight-forward way to change the default montage to one of the standard montages (e.g., “standard_1020”)?

Specifically, I am using the following sample:

    from mne.datasets import sample
    data_path = mne.datasets.sample.data_path()
    
    # the raw file containing the channel location + types
    sample_dir = data_path / "MEG" / "sample"
    raw_fname = sample_dir / "sample_audvis_raw.fif"
    
    # The paths to Freesurfer reconstructions
    subjects_dir = data_path / "subjects"
    subject = "sample"

That file was acquired on a Neuromag system, nowadays MEGIN. Recent EEG caps provided by MEGIN actually use a standard 10/05 system, so if we assume that the cap used by this file was the same, you can find the mapping here: meg-wiki-datasets/eeg-layout/mapping-eeg-64-chs.txt at main · fcbg-platforms/meg-wiki-datasets · GitHub

Then it’s simply a matter of renaming the channels, and if you want to remove the montage for a template one, you can then call raw.set_montage(None) followed by raw.set_montage("standard_1020").

Note however that this file includes a head digitization, thus the montage is actually the exact position of the electrodes in the head coordinate frame of this subject. Replacing this exact, measured, information with a template is strange.

Mathieu

1 Like

I see, that makes sense. Thanks for the quick and thorough reply!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.