.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "generated/tutorials/megin/20_rename_EEG_channels.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_generated_tutorials_megin_20_rename_EEG_channels.py: .. _tut-rename_eeg: Rename EEG channels =================== .. important:: This example requires the ``meg_wiki`` package to download the sample dataset. This package can be installed with ``pip``: .. code-block:: bash $ pip install git+https://github.com/fcbg-platforms/meg-wiki The EEG channel are named ``EEG 001``, ``EEG 002``, .. while they actually correspond to a standard 10/05 naming. The EEG channel layouts are available in :ref:`this section `. .. GENERATED FROM PYTHON SOURCE LINES 20-33 .. code-block:: Python from matplotlib import pyplot as plt from mne import set_log_level from mne.io import read_raw_fif from meg_wiki.datasets import sample from meg_wiki.eeg import load_mapping_64chs set_log_level("WARNING") fname = sample.data_path() / "recordings" / "meg-eeg-raw.fif" raw = read_raw_fif(fname, preload=False).pick("eeg") raw.info .. raw:: html
General
MNE object type Info
Measurement date 2000-01-01 at 00:00:00 UTC
Participant
Experimenter mne_anonymize
Acquisition
Sampling frequency 1000.00 Hz
Channels
EEG
Head & sensor digitization 435 points
Filters
Highpass 0.10 Hz
Lowpass 330.00 Hz


.. GENERATED FROM PYTHON SOURCE LINES 34-38 The mapping between the channel number and name in the standard 10/05 naming convention can be loaded and applied to the MNE object. The EEG channels can be visualize inn their true digitized location through the :class:`~mne.channels.DigMontage` attached. .. GENERATED FROM PYTHON SOURCE LINES 38-50 .. code-block:: Python f, ax = plt.subplots(1, 2, figsize=(16, 8)) ax[0].set_title("Original channel names") ax[1].set_title("Standard 10/05 channel names") # plot original channel names raw.get_montage().plot(axes=ax[0], show=False) # rename EEG channels mapping = load_mapping_64chs() raw.rename_channels(mapping) # plot renamed channel names raw.get_montage().plot(axes=ax[1], show=False) plt.show() .. image-sg:: /generated/tutorials/megin/images/sphx_glr_20_rename_EEG_channels_001.png :alt: Original channel names, Standard 10/05 channel names :srcset: /generated/tutorials/megin/images/sphx_glr_20_rename_EEG_channels_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.758 seconds) **Estimated memory usage:** 207 MB .. _sphx_glr_download_generated_tutorials_megin_20_rename_EEG_channels.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 20_rename_EEG_channels.ipynb <20_rename_EEG_channels.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 20_rename_EEG_channels.py <20_rename_EEG_channels.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: 20_rename_EEG_channels.zip <20_rename_EEG_channels.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_