.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_workshop/01_meg/plot_01_meg_preprocessing.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_workshop_01_meg_plot_01_meg_preprocessing.py: .. _preproc_meg: ======================= 02. Preprocess MEG data ======================= The :ref:`preprocessing pipeline ` runs the ICA algorithm for an automatic removal of eyes and heart related artefacts. A report is automatically generated and can be used to correct and/or fine-tune the correction in each subject. .. GENERATED FROM PYTHON SOURCE LINES 12-18 .. code-block:: default # Authors: Annalisa Pascarella # License: BSD (3-clause) # sphinx_gallery_thumbnail_number = 2 .. GENERATED FROM PYTHON SOURCE LINES 19-31 Import modules ^^^^^^^^^^^^^^ The first step is to import the modules we need in the script. We import mainly from |nipype| and |ephypype| packages. .. |nipype| raw:: html nipype .. |ephypype| raw:: html ephypype .. GENERATED FROM PYTHON SOURCE LINES 31-42 .. code-block:: default import json import pprint import os.path as op import nipype.pipeline.engine as pe from ephypype.nodes import create_iterator, create_datagrabber from ephypype.pipelines.preproc_meeg import create_pipeline_preproc_meeg .. GENERATED FROM PYTHON SOURCE LINES 43-54 Define data and variables ^^^^^^^^^^^^^^^^^^^^^^^^^ Let us specify the variables that are specific for the data analysis (the main directories where the data are stored, the list of subjects and sessions, ...) and the variables specific for the particular pipeline (downsampling frequency, EOG and ECG channels, cut-off frequencies, ...) in a |params.json| file (if it is does work, try to go on the github page, and right-click "Save As" on the Raw button). .. |params.json| replace:: :download:`json ` .. GENERATED FROM PYTHON SOURCE LINES 54-72 .. code-block:: default # Read experiment params as json params = json.load(open("params.json")) pprint.pprint({'parameters': params["general"]}) data_type = params["general"]["data_type"] subject_ids = params["general"]["subject_ids"] NJOBS = params["general"]["NJOBS"] session_ids = params["general"]["session_ids"] is_short = params["general"]["short"] # to analyze a shorter segment of data if "data_path" in params["general"].keys(): data_path = params["general"]["data_path"] else: data_path = op.expanduser("~") print("data_path : %s" % data_path) .. rst-class:: sphx-glr-script-out .. code-block:: none {'parameters': {'NJOBS': 1, 'data_path': '/home/pasca/Science/workshop/PracticalMEEG/ds000117/derivatives/meg_derivatives', 'data_type': 'fif', 'session_ids': ['01', '02'], 'short': False, 'subject_ids': ['sub-01'], 'subjects_dir': '/home/pasca/Science/workshop/PracticalMEEG/ds000117/FSF'}} data_path : /home/pasca/Science/workshop/PracticalMEEG/ds000117/derivatives/meg_derivatives .. GENERATED FROM PYTHON SOURCE LINES 73-80 Then, we read the **parameters for preprocessing** from the json file and print it. In the json file we set : the names of EoG and ECG channels, the filter settings, the downsampling frequency, the number of ICA components specified as a fraction of explained variance (0.999) and a reject dictionary to exclude time segments. The list of all input can be found in the definition of the pipeline :func:`~ephypype.pipelines.create_pipeline_preproc_meeg` .. GENERATED FROM PYTHON SOURCE LINES 80-90 .. code-block:: default pprint.pprint({'preprocessing parameters': params["preprocessing"]}) l_freq = params["preprocessing"]['l_freq'] h_freq = params["preprocessing"]['h_freq'] ECG_ch_name = params["preprocessing"]['ECG_ch_name'] EoG_ch_name = params["preprocessing"]['EoG_ch_name'] variance = params["preprocessing"]['variance'] reject = params["preprocessing"]['reject'] down_sfreq = params["preprocessing"]['down_sfreq'] .. rst-class:: sphx-glr-script-out .. code-block:: none {'preprocessing parameters': {'ECG_ch_name': 'EEG063', 'EoG_ch_name': ['EEG061', 'EEG062'], 'down_sfreq': 300, 'h_freq': 40, 'l_freq': 0.1, 'reject': {'grad': 4e-10, 'mag': 4e-12}, 'variance': 0.999}} .. GENERATED FROM PYTHON SOURCE LINES 91-111 Specify Nodes ^^^^^^^^^^^^^ Before to create a |workflow| we have to create the |nodes| that define the workflow itself. In this example the main Nodes are .. |workflow| raw:: html workflow .. |nodes| raw:: html nodes * ``infosource`` is a Node that just distributes values (:ref:`meg_infosourcenode`); * ``datasource`` is a |DataGrabber| Node that allows the user to **define flexible search patterns** which can be parameterized by user defined inputs (:ref:`meg_datagrabbernode`) ; * ``preproc_meg_pipeline`` is a Node containing the NeuroPycon pipeline created by :func:`~ephypype.pipelines.create_pipeline_preproc_meeg` (:ref:`preproc_meg_node`). .. |DataGrabber| raw:: html DataGrabber .. GENERATED FROM PYTHON SOURCE LINES 113-121 .. _meg_infosourcenode: Infosource """""""""" The ephypype function :func:`~ephypype.nodes.create_iterator` creates the ``infosource`` node that allows to distributes values: when we need to feed the different subject names into the workflow we only need a Node that can receive the input and distribute those inputs to the workflow. .. GENERATED FROM PYTHON SOURCE LINES 121-124 .. code-block:: default infosource = create_iterator(['subject_id', 'session_id'], [subject_ids, session_ids]) .. GENERATED FROM PYTHON SOURCE LINES 125-139 .. _meg_datagrabbernode: DataGrabber """"""""""" Then we create the ``datasource`` node to grab data. The ephypype function :func:`~ephypype.nodes.create_datagrabber` creates a node to grab data using |DataGrabber| in Nipype. The DataGrabber Interface allows to define **flexible search patterns** which can be parameterized by user defined inputs (such as subject ID, session, etc.). In this example we parameterize the pattern search with ``subject_id`` and ``session_id``. The ``template_args`` in this node iterates upon the values in the ``infosource`` node. We look for MEG data contained in ``ses-meg/meg`` (``ses-meg/meg_short``) folder. .. GENERATED FROM PYTHON SOURCE LINES 139-147 .. code-block:: default if is_short: template_path = '%s/ses-meg/meg_short/*%s*run*%s*sss*.fif' else: template_path = '%s/ses-meg/meg/*%s*run*%s*sss*.fif' template_args = [['subject_id', 'subject_id', 'session_id']] datasource = create_datagrabber(data_path, template_path, template_args) .. GENERATED FROM PYTHON SOURCE LINES 148-167 .. _preproc_meg_node: Preprocessing Node """""""""""""""""" Ephypype creates for us a pipeline which can be connected to these nodes we created. The preprocessing pipeline is implemented by the function :func:`~ephypype.pipelines.create_pipeline_preproc_meeg`, thus to instantiate this pipeline node, we pass our parameters to it. Each pipeline provided by NeuroPycon requires two different kind of inputs: * inputs of the pipeline * **inputnode**: particular inputs defined after the creation of the pipeline; an inputnode of a pipeline is defined by an output of a previous Node. For example, looking at the definition of :func:`~ephypype.pipelines.create_pipeline_preproc_meeg` we have the input of the pipeline (e.g., ``main_path``, ``lfreq``) and the inputnode ``raw_file`` and ``subject_id``. In the next section :ref:`workflow_meg` we'll see how to specify these inputnode. .. GENERATED FROM PYTHON SOURCE LINES 167-174 .. code-block:: default preproc_workflow = create_pipeline_preproc_meeg( data_path, pipeline_name="preproc_meg_dsamp_pipeline", l_freq=l_freq, h_freq=h_freq, variance=variance, ECG_ch_name=ECG_ch_name, EoG_ch_name=EoG_ch_name, data_type=data_type, down_sfreq=down_sfreq) .. rst-class:: sphx-glr-script-out .. code-block:: none *** main_path -> /home/pasca/Science/workshop/PracticalMEEG/ds000117/derivatives/meg_derivatives *** .. GENERATED FROM PYTHON SOURCE LINES 175-192 .. _workflow_meg: Specify Workflows and Connect Nodes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The purpose of Workflow is to guide the sequential execution of Nodes: we create a main Workflow to connect the different Nodes and define the data flow from the outputs of one Node to the inputs of the connected Nodes. The specified connections create our workflow: the created nodes and the dependencies between them are represented as a graph (see :ref:`graph_preproc_meg`), in this way it is easy to see which nodes are executed and in which order. It is important to point out that we have to connect the output and input fields of each node to the output and input fields of another node. Now, we create our main workflow and specify the ``base_dir`` which tells nipype the directory in which to store the outputs. .. GENERATED FROM PYTHON SOURCE LINES 192-199 .. code-block:: default preproc_wf_name = 'preprocessing_dsamp_short_workflow' if is_short \ else 'preprocessing_dsamp_workflow' main_workflow = pe.Workflow(name=preproc_wf_name) main_workflow.base_dir = data_path .. GENERATED FROM PYTHON SOURCE LINES 200-204 We then connect the nodes two at a time. First, we connect the two outputs (``subject_id`` and ``session_id``) of the :ref:`meg_infosourcenode` node to the :ref:`meg_datagrabbernode` node. So, these two nodes taken together can grab data. .. GENERATED FROM PYTHON SOURCE LINES 204-208 .. code-block:: default main_workflow.connect(infosource, 'subject_id', datasource, 'subject_id') main_workflow.connect(infosource, 'session_id', datasource, 'session_id') .. GENERATED FROM PYTHON SOURCE LINES 209-211 Similarly, for the inputnode of the :ref:`preproc_meg_node`. Things will become clearer in a moment when we plot the graph of the workflow. .. GENERATED FROM PYTHON SOURCE LINES 211-217 .. code-block:: default main_workflow.connect(infosource, 'subject_id', preproc_workflow, 'inputnode.subject_id') main_workflow.connect(datasource, 'raw_file', preproc_workflow, 'inputnode.raw_file') .. GENERATED FROM PYTHON SOURCE LINES 218-220 .. note:: The inputnode ``raw_file`` of the pipeline node ``preproc_workflow`` is the output of ``datasource`` node. .. GENERATED FROM PYTHON SOURCE LINES 222-228 Run workflow ^^^^^^^^^^^^ After we have specified all the nodes and connections of the workflow, the last step is to run it by calling the ``run()`` method. It’s also possible to generate static graph representing nodes and connections between them by calling ``write_graph`` method. .. GENERATED FROM PYTHON SOURCE LINES 228-231 .. code-block:: default main_workflow.write_graph(graph2use='colored') # optional .. rst-class:: sphx-glr-script-out .. code-block:: none '/home/pasca/Science/workshop/PracticalMEEG/ds000117/derivatives/meg_derivatives/preprocessing_dsamp_workflow/graph.png' .. GENERATED FROM PYTHON SOURCE LINES 232-242 .. _graph_preproc_meg: Workflow graph """""""""""""" Take a moment to pause and notice how the connections here correspond to how we connected the nodes. In other words, the connections we specified created the workflow: the nodes and the dependencies between them are represented as a graph, in this way it is easy to see which nodes are executed and in which order. .. GENERATED FROM PYTHON SOURCE LINES 242-249 .. code-block:: default import matplotlib.pyplot as plt # noqa img = plt.imread(op.join(data_path, preproc_wf_name, 'graph.png')) plt.figure(figsize=(6, 6)) plt.imshow(img) plt.axis('off') .. image-sg:: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_001.png :alt: plot 01 meg preprocessing :srcset: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none (-0.5, 351.5, 498.5, -0.5) .. GENERATED FROM PYTHON SOURCE LINES 250-252 .. note:: We have to connect the output and input fields of each node to the output and input fields of another node. .. GENERATED FROM PYTHON SOURCE LINES 254-258 Run """ Finally, we are now ready to execute our workflow. .. GENERATED FROM PYTHON SOURCE LINES 258-263 .. code-block:: default main_workflow.config['execution'] = {'remove_unnecessary_outputs': 'false'} # Run workflow locally on 1 CPU main_workflow.run(plugin='LegacyMultiProc', plugin_args={'n_procs': NJOBS}) .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 264-268 .. note:: If we rerun the workflow, only the nodes whose inputs have changed since the last run will be executed again. If not, it will simply return cached results. This is achieved by recording a hash of the inputs. .. GENERATED FROM PYTHON SOURCE LINES 271-284 Results ^^^^^^^ The output of this workflow is the preprocessed data stored in the workflow directory defined by ``base_dir``. Here we find the folder ``preprocessing_dsamp_workflow`` where all the results of each iteration are sorted by nodes. The cleaned data will be used in :ref:`plot_events_inverse`. It’s a good rule to inspect the report file saved in the ``ica`` dir to look at the excluded ICA components. .. note:: You could use this :download:`notebook ` to better inspect your ICs. .. GENERATED FROM PYTHON SOURCE LINES 284-299 .. code-block:: default import mne # noqa from ephypype.gather import get_results # noqa ica_files, raw_files = get_results(main_workflow.base_dir, main_workflow.name, pipeline='ica') for ica_file, raw_file in zip(ica_files, raw_files): print(f'*** {raw_file} ***') raw = mne.io.read_raw_fif(raw_file) ica = mne.preprocessing.read_ica(ica_file) ica.plot_properties(raw, picks=ica.exclude, figsize=[4.5, 4.5]) # ica.plot_components() # ica.plot_sources(raw) .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_002.png :alt: ICA025 (mag), Segment image and ERP/ERF, Spectrum, Dropped segments: 0.00 % :srcset: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_002.png :class: sphx-glr-multi-img * .. image-sg:: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_003.png :alt: ICA030 (mag), Segment image and ERP/ERF, Spectrum, Dropped segments: 0.00 % :srcset: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_003.png :class: sphx-glr-multi-img * .. image-sg:: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_004.png :alt: ICA027 (mag), Segment image and ERP/ERF, Spectrum, Dropped segments: 0.00 % :srcset: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_004.png :class: sphx-glr-multi-img * .. image-sg:: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_005.png :alt: ICA019 (mag), Segment image and ERP/ERF, Spectrum, Dropped segments: 0.00 % :srcset: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_005.png :class: sphx-glr-multi-img * .. image-sg:: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_006.png :alt: ICA026 (mag), Segment image and ERP/ERF, Spectrum, Dropped segments: 0.00 % :srcset: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_006.png :class: sphx-glr-multi-img * .. image-sg:: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_007.png :alt: ICA021 (mag), Segment image and ERP/ERF, Spectrum, Dropped segments: 0.00 % :srcset: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_007.png :class: sphx-glr-multi-img * .. image-sg:: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_008.png :alt: ICA020 (mag), Segment image and ERP/ERF, Spectrum, Dropped segments: 0.00 % :srcset: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_008.png :class: sphx-glr-multi-img * .. image-sg:: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_009.png :alt: ICA009 (mag), Segment image and ERP/ERF, Spectrum, Dropped segments: 0.00 % :srcset: /auto_workshop/01_meg/images/sphx_glr_plot_01_meg_preprocessing_009.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none *** /home/pasca/Science/workshop/PracticalMEEG/ds000117/derivatives/meg_derivatives/preprocessing_dsamp_workflow/preproc_meg_dsamp_pipeline/_session_id_01_subject_id_sub-01/ica/sub-01_ses-meg_task-facerecognition_run-01_proc-sss_meg_filt_dsamp_ica.fif *** Opening raw data file /home/pasca/Science/workshop/PracticalMEEG/ds000117/derivatives/meg_derivatives/preprocessing_dsamp_workflow/preproc_meg_dsamp_pipeline/_session_id_01_subject_id_sub-01/ica/sub-01_ses-meg_task-facerecognition_run-01_proc-sss_meg_filt_dsamp_ica.fif... /home/pasca/Tools/python/packages/neuropycon/ephypype/doc/workshop/01_meg/plot_01_meg_preprocessing.py:293: RuntimeWarning: This filename (/home/pasca/Science/workshop/PracticalMEEG/ds000117/derivatives/meg_derivatives/preprocessing_dsamp_workflow/preproc_meg_dsamp_pipeline/_session_id_01_subject_id_sub-01/ica/sub-01_ses-meg_task-facerecognition_run-01_proc-sss_meg_filt_dsamp_ica.fif) does not conform to MNE naming conventions. All raw files should end with raw.fif, raw_sss.fif, raw_tsss.fif, _meg.fif, _eeg.fif, _ieeg.fif, raw.fif.gz, raw_sss.fif.gz, raw_tsss.fif.gz, _meg.fif.gz, _eeg.fif.gz or _ieeg.fif.gz raw = mne.io.read_raw_fif(raw_file) Range : 67800 ... 157799 = 226.000 ... 525.997 secs Ready. /home/pasca/Tools/python/packages/neuropycon/ephypype/doc/workshop/01_meg/plot_01_meg_preprocessing.py:294: RuntimeWarning: This filename (/home/pasca/Science/workshop/PracticalMEEG/ds000117/derivatives/meg_derivatives/preprocessing_dsamp_workflow/preproc_meg_dsamp_pipeline/_session_id_01_subject_id_sub-01/ica/sub-01_ses-meg_task-facerecognition_run-01_proc-sss_meg_filt_dsamp_ica_solution.fif) does not conform to MNE naming conventions. All ICA files should end with -ica.fif, -ica.fif.gz, _ica.fif or _ica.fif.gz ica = mne.preprocessing.read_ica(ica_file) Reading /home/pasca/Science/workshop/PracticalMEEG/ds000117/derivatives/meg_derivatives/preprocessing_dsamp_workflow/preproc_meg_dsamp_pipeline/_session_id_01_subject_id_sub-01/ica/sub-01_ses-meg_task-facerecognition_run-01_proc-sss_meg_filt_dsamp_ica_solution.fif ... Now restoring ICA solution ... Ready. Using multitaper spectrum estimation with 7 DPSS windows /home/pasca/Tools/python/packages/neuropycon/ephypype/doc/workshop/01_meg/plot_01_meg_preprocessing.py:295: RuntimeWarning: (X, Y) fit (3.1, 32.2) more than 20 mm from head frame origin ica.plot_properties(raw, picks=ica.exclude, figsize=[4.5, 4.5]) Not setting metadata 150 matching events found No baseline correction applied 0 projection items activated /home/pasca/Tools/python/packages/neuropycon/ephypype/doc/workshop/01_meg/plot_01_meg_preprocessing.py:295: RuntimeWarning: (X, Y) fit (3.1, 32.2) more than 20 mm from head frame origin ica.plot_properties(raw, picks=ica.exclude, figsize=[4.5, 4.5]) Not setting metadata 150 matching events found No baseline correction applied 0 projection items activated /home/pasca/Tools/python/packages/neuropycon/ephypype/doc/workshop/01_meg/plot_01_meg_preprocessing.py:295: RuntimeWarning: (X, Y) fit (3.1, 32.2) more than 20 mm from head frame origin ica.plot_properties(raw, picks=ica.exclude, figsize=[4.5, 4.5]) Not setting metadata 150 matching events found No baseline correction applied 0 projection items activated *** /home/pasca/Science/workshop/PracticalMEEG/ds000117/derivatives/meg_derivatives/preprocessing_dsamp_workflow/preproc_meg_dsamp_pipeline/_session_id_02_subject_id_sub-01/ica/sub-01_ses-meg_task-facerecognition_run-02_proc-sss_meg_filt_dsamp_ica.fif *** Opening raw data file /home/pasca/Science/workshop/PracticalMEEG/ds000117/derivatives/meg_derivatives/preprocessing_dsamp_workflow/preproc_meg_dsamp_pipeline/_session_id_02_subject_id_sub-01/ica/sub-01_ses-meg_task-facerecognition_run-02_proc-sss_meg_filt_dsamp_ica.fif... /home/pasca/Tools/python/packages/neuropycon/ephypype/doc/workshop/01_meg/plot_01_meg_preprocessing.py:293: RuntimeWarning: This filename (/home/pasca/Science/workshop/PracticalMEEG/ds000117/derivatives/meg_derivatives/preprocessing_dsamp_workflow/preproc_meg_dsamp_pipeline/_session_id_02_subject_id_sub-01/ica/sub-01_ses-meg_task-facerecognition_run-02_proc-sss_meg_filt_dsamp_ica.fif) does not conform to MNE naming conventions. All raw files should end with raw.fif, raw_sss.fif, raw_tsss.fif, _meg.fif, _eeg.fif, _ieeg.fif, raw.fif.gz, raw_sss.fif.gz, raw_tsss.fif.gz, _meg.fif.gz, _eeg.fif.gz or _ieeg.fif.gz raw = mne.io.read_raw_fif(raw_file) Range : 18600 ... 108599 = 62.000 ... 361.997 secs Ready. /home/pasca/Tools/python/packages/neuropycon/ephypype/doc/workshop/01_meg/plot_01_meg_preprocessing.py:294: RuntimeWarning: This filename (/home/pasca/Science/workshop/PracticalMEEG/ds000117/derivatives/meg_derivatives/preprocessing_dsamp_workflow/preproc_meg_dsamp_pipeline/_session_id_02_subject_id_sub-01/ica/sub-01_ses-meg_task-facerecognition_run-02_proc-sss_meg_filt_dsamp_ica_solution.fif) does not conform to MNE naming conventions. All ICA files should end with -ica.fif, -ica.fif.gz, _ica.fif or _ica.fif.gz ica = mne.preprocessing.read_ica(ica_file) Reading /home/pasca/Science/workshop/PracticalMEEG/ds000117/derivatives/meg_derivatives/preprocessing_dsamp_workflow/preproc_meg_dsamp_pipeline/_session_id_02_subject_id_sub-01/ica/sub-01_ses-meg_task-facerecognition_run-02_proc-sss_meg_filt_dsamp_ica_solution.fif ... Now restoring ICA solution ... Ready. Using multitaper spectrum estimation with 7 DPSS windows /home/pasca/Tools/python/packages/neuropycon/ephypype/doc/workshop/01_meg/plot_01_meg_preprocessing.py:295: RuntimeWarning: (X, Y) fit (3.1, 32.2) more than 20 mm from head frame origin ica.plot_properties(raw, picks=ica.exclude, figsize=[4.5, 4.5]) Not setting metadata 150 matching events found No baseline correction applied 0 projection items activated /home/pasca/Tools/python/packages/neuropycon/ephypype/doc/workshop/01_meg/plot_01_meg_preprocessing.py:295: RuntimeWarning: (X, Y) fit (3.1, 32.2) more than 20 mm from head frame origin ica.plot_properties(raw, picks=ica.exclude, figsize=[4.5, 4.5]) Not setting metadata 150 matching events found No baseline correction applied 0 projection items activated /home/pasca/Tools/python/packages/neuropycon/ephypype/doc/workshop/01_meg/plot_01_meg_preprocessing.py:295: RuntimeWarning: (X, Y) fit (3.1, 32.2) more than 20 mm from head frame origin ica.plot_properties(raw, picks=ica.exclude, figsize=[4.5, 4.5]) Not setting metadata 150 matching events found No baseline correction applied 0 projection items activated /home/pasca/Tools/python/packages/neuropycon/ephypype/doc/workshop/01_meg/plot_01_meg_preprocessing.py:295: RuntimeWarning: (X, Y) fit (3.1, 32.2) more than 20 mm from head frame origin ica.plot_properties(raw, picks=ica.exclude, figsize=[4.5, 4.5]) Not setting metadata 150 matching events found No baseline correction applied 0 projection items activated /home/pasca/Tools/python/packages/neuropycon/ephypype/doc/workshop/01_meg/plot_01_meg_preprocessing.py:295: RuntimeWarning: (X, Y) fit (3.1, 32.2) more than 20 mm from head frame origin ica.plot_properties(raw, picks=ica.exclude, figsize=[4.5, 4.5]) Not setting metadata 150 matching events found No baseline correction applied 0 projection items activated .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 18.899 seconds) .. _sphx_glr_download_auto_workshop_01_meg_plot_01_meg_preprocessing.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_01_meg_preprocessing.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_01_meg_preprocessing.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_