cmp.cli.visualize_eeg_pipeline_outputs module

This module defines the visualize_eeg_pipeline_outputs script that loads and displays the different MNE outputs of the EEG pipeline.

Examples

Here are a few usage examples:

  1. Show all electrode epochs

    $ python cmp/cli/visualize_eeg_pipeline_outputs.py                 --epo_file /path/to/sub-01/eeg/sub-01_task-faces_epo.fif
    
  2. Carpet plot of ROI time series when using Cartool for ESI

    $ python cmp/cli/visualize_eeg_pipeline_outputs.py                 --epo_file /path/to/sub-01/eeg/sub-01_task-faces_epo.fif                 --rtc_file /path/to/sub-01_task-faces_atlas-L2018_res-scale1_timeseries.npy                 --atlas_annot lausanne2018.scale1                 --fs_subject sub-01                 --fs_subjects_dir /path/to/derivatives/freesurfer-7.1.1                 --roi_tsv_file /path/to/sub-01_atlas-L2018_res-scale1_dseg.tsv
    
  3. Carpet plot of ROI time series when using MNE for ESI

    $ python cmp/cli/visualize_eeg_pipeline_outputs.py                 --epo_file /path/to/sub-01/eeg/sub-01_task-faces_epo.fif                 --rtc_file /path/to/sub-01_task-faces_atlas-L2018_res-scale1_timeseries.npy                 --atlas_annot lausanne2018.scale1                 --fs_subject sub-01                 --fs_subjects_dir /path/to/derivatives/freesurfer-7.1.1                 --roi_tsv_file /path/to/sub-01_atlas-L2018_res-scale1_dseg.tsv
    
  4. Display BEM surfaces only on T1w

    $ python cmp/cli/visualize_eeg_pipeline_outputs.py                  --bem_file /path/to/sub-01_task-faces_bem.fif                  --fs_subject sub-01                  --fs_subjects_dir /path/to/derivatives/freesurfer-7.1.1
    
  5. Display BEM surfaces and source position on T1w

$ python cmp/cli/visualize_eeg_pipeline_outputs.py              --bem_file /path/to/sub-01_task-faces_bem.fif              --fs_subject sub-01              --fs_subjects_dir /path/to/derivatives/freesurfer-7.1.1              --src_file /path/to/sub-01_task-faces_src.fif
  1. Plot the noise covariance

$ python cmp/cli/visualize_eeg_pipeline_outputs.py              --epo_file /path/to/sub-01_task-faces_epo.fif              --fs_subject sub-01              --fs_subjects_dir /path/to/derivatives/freesurfer-7.1.1              --noisecov_file /path/to/sub-01_task-faces_noisecov.fif
cmp.cli.visualize_eeg_pipeline_outputs.create_parser()[source]

Create the argument parser of visualize_eeg_pipeline_outputs python script.

Returns

p – Argument parser

Return type

argparse.ArgumentParser

cmp.cli.visualize_eeg_pipeline_outputs.create_roi_labels(mean_rtc, fs_subject, fs_subjects_dir, atlas_annot, roi_tsv_file=None)[source]

Create list of labels depending on the employed EEG pipeline (Cartool vs. MNE).

Parameters
  • mean_rtc (numpy.Array) – Numpy array containing the ROI time-series

  • fs_subject (str) – Freesurfer subject directory

  • fs_subjects_dir (str) – Freesurfer subjects directory

  • atlas_annot (str) – Basename of parcellation annotation file

  • roi_tsv_file (str) – Path to parcellation index/label mapping TSV file

Returns

  • mean_rtc (numpy.Array) – Numpy array containing the ROI time-series

  • roi_labels (list) – List of ROI labels in the order of the rows of mean_rtc

cmp.cli.visualize_eeg_pipeline_outputs.main()[source]

Main function that load and display different outputs of the EEG pipeline using MNE visualization features.

Returns

exit_code

An exit code given to sys.exit() that can be:

  • ’0’ in case of successful completion

  • ’1’ in case of an error

Return type

{0, 1}

cmp.cli.visualize_eeg_pipeline_outputs.plot_roi_time_series(mean_rtc, roi_labels, t_min, t_max, title=None)[source]

Display ROI time series as a carpet plot.

Parameters
  • mean_rtc (numpy.array) – Numpy array containing ROI time series

  • roi_labels (list) – List of ROI labels

  • t_min (float) – Relative start time in sec. (x-axis)

  • t_max (float) – Relative end time in sec. (x-axis)

  • title (str) – Title of the figure