.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_eeg_batch.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_auto_examples_plot_eeg_batch.py: Complexity of every channel of a real EEG ========================================= One minute of resting EEG, eyes open, from subject 1 of the PhysioNet EEG Motor Movement/Imagery Dataset (64 channels, 160 Hz; Schalk et al. 2004, ODC-By 1.0). MNE downloads and caches it on first run. .. GENERATED FROM PYTHON SOURCE LINES 9-23 .. code-block:: Python import matplotlib.pyplot as plt import mne import numpy import complexeva (path,) = mne.datasets.eegbci.load_data(1, [1], update_path=False) raw = mne.io.read_raw_edf(path, preload=True, verbose=False) mne.datasets.eegbci.standardize(raw) raw.set_montage("colin27_1005") eeg = raw.get_data() # (channels, time): time on the last axis print(eeg.shape) .. rst-class:: sphx-glr-script-out .. code-block:: none Using default location ~/mne_data for EEGBCI... Downloading EEGBCI data Downloading file 'S001/S001R01.edf' from 'https://physionet.org/files/eegmmidb/1.0.0/S001/S001R01.edf' to '/home/runner/mne_data/MNE-eegbci-data/files/eegmmidb/1.0.0'. Download complete in 00s (1.2 MB) (64, 9760) .. GENERATED FROM PYTHON SOURCE LINES 24-25 Pass all 64 channels at once and get one value per channel. .. GENERATED FROM PYTHON SOURCE LINES 25-40 .. code-block:: Python values = { "Higuchi FD": complexeva.hfd(eeg), "permutation entropy": complexeva.permutation_entropy(eeg), "sample entropy": complexeva.sample_entropy(eeg), } fig, axes = plt.subplots(1, 3, figsize=(9, 3.2), layout="constrained") for ax, (name, value) in zip(axes, values.items()): image, _ = mne.viz.plot_topomap( value, raw.info, axes=ax, cmap="viridis", vlim=(numpy.min(value), numpy.max(value)), show=False ) fig.colorbar(image, ax=ax, shrink=0.7) ax.set_title(name) plt.show() .. image-sg:: /auto_examples/images/sphx_glr_plot_eeg_batch_001.png :alt: Higuchi FD, permutation entropy, sample entropy :srcset: /auto_examples/images/sphx_glr_plot_eeg_batch_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 12.803 seconds) .. _sphx_glr_download_auto_examples_plot_eeg_batch.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_eeg_batch.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_eeg_batch.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_eeg_batch.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_