### Setup Development Environment Source: https://eegprep.org/contributing.html Commands to initialize the uv-managed environment and install dependencies. ```bash uv python install 3.11 uv sync --group dev ``` ```bash uv sync --extra docs --group dev ``` -------------------------------- ### Install all optional dependencies Source: https://eegprep.org/user_guide/installation.html Commands to install optional dependencies in bulk or by specific categories. ```bash uv add "eegprep[all]" ``` ```bash uv add "eegprep[torch,gui,docs]" ``` -------------------------------- ### Start TigerVNC Virtual Desktop Source: https://eegprep.org/user_guide/visual_parity.html Alternative virtual display setup using TigerVNC for local screenshot capture. ```bash # Terminal 1: keep the virtual X server running. Xvnc :99 -geometry 1920x1080 -depth 24 -SecurityTypes None -localhost \ -ac -noreset +extension GLX +render ``` ```bash # Terminal 2: run captures against that display. export DISPLAY=:99 xdpyinfo | head ``` -------------------------------- ### Include practical examples in docstrings Source: https://eegprep.org/contributing.html Demonstrates how to provide usage examples within function docstrings. ```python def load_bids_dataset(bids_root, subject_id): """Load a BIDS-formatted EEG dataset. Examples -------- >>> import eegprep >>> eeg = eegprep.load_bids_dataset('/data/bids_root', 'sub-001') >>> print(eeg.nbchan) # Number of channels 64 """ pass ``` -------------------------------- ### Install EEGPrep Source: https://eegprep.org/faq.html Methods for installing the library via uv or pip, and setting up a development environment. ```bash uv add eegprep ``` ```bash pip install eegprep ``` ```bash git clone https://github.com/sccn/eegprep.git cd eegprep uv sync --group dev ``` -------------------------------- ### Install eegprep from source Source: https://eegprep.org/user_guide/installation.html Commands to clone the repository and set up the development environment. ```bash git clone https://github.com/sccn/eegprep.git cd eegprep uv sync --group dev ``` -------------------------------- ### Install Extensions from PyPI Source: https://eegprep.org/user_guide/extensions.html Install a publicly available extension using its package name. ```bash uv add eegprep-ext-foo ``` -------------------------------- ### Install GUI Dependencies Source: https://eegprep.org/user_guide/visual_parity.html Install the necessary dependencies for the EEGPREP GUI before performing visual captures. ```bash uv sync --extra gui --group dev ``` -------------------------------- ### Install Documentation Dependencies Source: https://eegprep.org/development.html Install additional dependencies required for building and maintaining project documentation. ```bash uv sync --extra docs --group dev ``` -------------------------------- ### Interpolation output example Source: https://eegprep.org/auto_examples/plot_channel_interpolation.html Example console output after running the interpolation process. ```text Performing channel interpolation... ---------------------------------------------------------------------- Interpolation complete! Interpolated data shape: (32, 10000) Interpolated channels: ['Fz', 'Pz', 'Fc1'] ``` -------------------------------- ### Importing Dependencies and Setup Source: https://eegprep.org/_downloads/cc03e6f6f48055c0c64be4c8bef1fac5/plot_basic_preprocessing.ipynb Initializes the environment by importing necessary libraries and configuring the local path for eegprep. ```python import numpy as np import matplotlib.pyplot as plt from mne import create_info, EpochsArray from mne.channels import make_standard_montage import sys sys.path.insert(0, '/Users/baristim/Projects/eegprep/src') import eegprep # Set random seed for reproducibility np.random.seed(42) ``` -------------------------------- ### Install EEGPrep Source: https://eegprep.org/faq.html Commands to install the package or sync development dependencies. ```bash uv add eegprep ``` ```bash uv sync --group dev ``` -------------------------------- ### eegprep.build_safe_install_commands(entry) Source: https://eegprep.org/api/generated/eegprep.build_safe_install_commands.html Generates a dictionary of safe installation commands for a given catalog entry. ```APIDOC ## eegprep.build_safe_install_commands ### Description Returns copyable install commands for a catalog entry without executing them. ### Parameters - **entry** (ExtensionCatalogEntry) - Required - The catalog entry to generate commands for. ### Return Type dict[str, str] ``` -------------------------------- ### Install PyTorch dependencies Source: https://eegprep.org/user_guide/installation.html Commands to install PyTorch with varying levels of hardware support using uv. ```bash uv add torch ``` ```bash uv add torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 ``` ```bash uv add torch --index-url https://download.pytorch.org/whl/cpu ``` -------------------------------- ### Create uv Environment Source: https://eegprep.org/development.html Install the required Python version and synchronize the development environment dependencies. ```bash uv python install 3.11 uv sync --group dev ``` -------------------------------- ### Install eegprep with documentation dependencies Source: https://eegprep.org/user_guide/installation.html Use this command to include additional dependencies required for building or developing documentation. ```bash uv sync --group dev --extra docs ``` -------------------------------- ### eegprep.extension_catalog.build_safe_install_commands Source: https://eegprep.org/api/extensions.html Generates copyable installation commands for a specific catalog entry without executing them. ```APIDOC ## eegprep.extension_catalog.build_safe_install_commands(entry) ### Description Returns copyable install commands for a catalog entry without executing them. ### Parameters - **entry** (ExtensionCatalogEntry) - Required - The catalog entry to generate commands for. ### Returns - **dict[str, str]** - A dictionary of install commands. ``` -------------------------------- ### Install Extensions from GitHub Source: https://eegprep.org/user_guide/extensions.html Install extensions directly from a GitHub repository, with options to pin specific versions using tags. ```bash uv add git+https://github.com/lab/eegprep-ext-foo ``` ```bash uv add git+https://github.com/lab/eegprep-ext-foo --tag v0.3.0 ``` -------------------------------- ### eegprep.build_safe_install_commands Source: https://eegprep.org/api/extensions.html Generates copyable strings for installing extensions safely without executing subprocesses. ```APIDOC ## build_safe_install_commands() ### Description Returns copyable strings such as 'uv add eegprep-ext-foo' or 'pip install ...' for extension installation. ``` -------------------------------- ### Install Local or Editable Extensions Source: https://eegprep.org/user_guide/extensions.html Install extensions from a local directory using editable mode, optionally including specific package extras. ```bash uv add --editable /path/to/eegprep-ext-foo ``` ```bash uv add --editable "/path/to/eegprep-ext-foo[models]" ``` -------------------------------- ### Start Xvfb Virtual Desktop Source: https://eegprep.org/user_guide/visual_parity.html Initialize an Xvfb virtual display for MATLAB GUI capture. ```bash Xvfb :99 -screen 0 1920x1080x24 -ac +extension GLX +render -noreset \ > /tmp/xvfb99.log 2>&1 & export DISPLAY=:99 openbox > /tmp/openbox99.log 2>&1 & xdpyinfo | head ``` -------------------------------- ### eegprep.eeglab(onearg=None, *, session=None, show=True, block=False, all_menus=None, include_plugins=True, native_menu_bar=None, native_file_dialogs=True) Source: https://eegprep.org/api/generated/eegprep.eeglab.html Starts the EEGPrep EEGLAB-style main window. This function allows for GUI initialization with various configuration options for menus, dialogs, and session management. ```APIDOC ## eegprep.eeglab ### Description Starts the EEGPrep EEGLAB-style main window. This function can be used to launch the GUI or return a session object depending on the provided arguments. ### Parameters - **onearg** (str | None) - Optional - EEGLAB-like command. "nogui" returns a session only, "full" enables legacy/advanced menu items, and "versions" returns the package version string. - **session** (EEGPrepSession | None) - Optional - Optional existing GUI session. - **show** (bool) - Optional - Show the Qt window before returning. - **block** (bool) - Optional - Enter the Qt event loop. - **all_menus** (bool | None) - Optional - Override EEG_OPTIONS["option_allmenus"]. - **include_plugins** (bool) - Optional - Include plugin-contributed menus. - **native_menu_bar** (bool | None) - Optional - Use the native macOS menu bar when True. None keeps EEGPrep’s platform default; set False to keep menus in the window on macOS. - **native_file_dialogs** (bool) - Optional - Use platform-native file pickers when True. ### Returns - **EEGPrepMainWindow** (Any) - The main window object by default, or EEGPrepSession if onearg="nogui" is specified. ``` -------------------------------- ### Launch EEGPrep GUI Source: https://eegprep.org/user_guide/gui_help_menus.html Commands to start the EEGPrep GUI or the interactive console session. ```bash uv run eegprep-gui --full ``` ```bash uv run eegprep-console --full ``` -------------------------------- ### Launch EEGPrep GUI Only Source: https://eegprep.org/user_guide/gui_tutorials.html Starts the GUI without an accompanying console window. ```bash uv run eegprep-gui --full ``` -------------------------------- ### eegprep.gui(onearg=None, *, session=None, show=True, block=False, all_menus=None, include_plugins=True, native_menu_bar=None, native_file_dialogs=True) Source: https://eegprep.org/api/generated/eegprep.gui.html Starts the EEGPrep GUI. This function acts as an EEGPrep-first alias for the standard EEGLAB initialization. ```APIDOC ## eegprep.gui ### Description Starts the EEGPrep GUI. This is the EEGPrep-first alias for eeglab(), which remains available for EEGLAB-compatible workflows. ### Parameters - **onearg** (str | None) - Optional - Positional argument. - **session** (EEGPrepSession | None) - Optional - The EEGPrep session object. - **show** (bool) - Optional - Whether to show the GUI. - **block** (bool) - Optional - Whether to block execution. - **all_menus** (bool | None) - Optional - Whether to display all menus. - **include_plugins** (bool) - Optional - Whether to include plugins. - **native_menu_bar** (bool | None) - Optional - Whether to use the native menu bar. - **native_file_dialogs** (bool) - Optional - Whether to use native file dialogs. ### Returns - **Any** - The result of the GUI initialization. ``` -------------------------------- ### Install GPU Support Source: https://eegprep.org/faq.html Commands to add PyTorch and MNE-Python CUDA support for accelerated computations. ```bash uv add torch # For GPU support uv add "mne[cuda]" # For MNE GPU support ``` -------------------------------- ### Install Extensions from Private Indices Source: https://eegprep.org/user_guide/extensions.html Install extensions from a private package index, either supplementing or replacing the default PyPI index. ```bash uv add --index https://packages.lab.example/simple eegprep-ext-foo ``` ```bash uv add --default-index https://packages.lab.example/simple eegprep-ext-foo ``` -------------------------------- ### Execute Preprocessing Commands Source: https://eegprep.org/user_guide/interactive_console.html Examples of running preprocessing functions that update the shared GUI session. ```python pop_resample(EEG, 64) ``` ```python eegprep.pop_reref(EEG, []) ``` ```python EEG, LASTCOM = pop_reref(EEG, []) ``` -------------------------------- ### Install eegprep using uv Source: https://eegprep.org/user_guide/installation.html Use these commands to add eegprep to a project managed by uv. ```bash uv add eegprep ``` ```bash uv add "eegprep[all]" ``` -------------------------------- ### Console output example Source: https://eegprep.org/auto_examples/plot_public_api_and_plugins.html Expected output from running the console workspace and plugin inspection code. ```text CURRENTSET: 1 Dataset name: console demo Bundled plugins: clean_rawdata, ICLabel, firfilt, DIPFIT, EEG-BIDS ICLabel status: [1] ``` -------------------------------- ### Example output for data preparation Source: https://eegprep.org/auto_examples/plot_ica_and_iclabel.html Expected console output after running the data preparation script. ```text Preparing data for ICA... ---------------------------------------------------------------------- Data after preprocessing: Shape: (32, 9330) Range: [-17.33, 16.56] µV ``` -------------------------------- ### Launch the Interactive Console Source: https://eegprep.org/user_guide/interactive_console.html Commands to start the EEGPrep console with full GUI integration, optionally enabling native file dialogs. ```bash uv run eegprep-console --full ``` ```bash uv run eegprep-console --full --native-file-dialogs ``` -------------------------------- ### Example Interpolation Output Source: https://eegprep.org/auto_examples/plot_channel_interpolation.html Shows the expected console output format for the channel interpolation summary. ```text ====================================================================== SUMMARY ====================================================================== Total channels: 32 Bad channels identified: 3 Percentage of bad channels: 9.4% Mean correlation (good channels): 1.0000 Mean correlation (bad channels): 0.3408 Interpolation successfully recovered bad channels Interpolated channels can be used for further analysis ====================================================================== Recommendations: ---------------------------------------------------------------------- 1. Always inspect bad channels visually before interpolation 2. Use multiple criteria for bad channel detection 3. Verify interpolation quality with correlation analysis 4. Document which channels were interpolated in your analysis 5. Consider excluding channels with >20% bad data 6. Use spatial information (electrode positions) for interpolation 7. Validate results with domain expertise ---------------------------------------------------------------------- ``` -------------------------------- ### Example Output for Component Rejection Source: https://eegprep.org/auto_examples/plot_ica_and_iclabel.html Displays the expected console output format when running the component rejection script. ```text ====================================================================== COMPONENT REJECTION RECOMMENDATIONS ====================================================================== Rejection Criteria: Confidence threshold: 0.5 Artifact classes: ['Muscle', 'Eye', 'Heart', 'Line Noise', 'Channel Noise'] Components recommended for rejection: 1 Components to reject (first 10): ---------------------------------------------------------------------- Comp Class Confidence ---------------------------------------------------------------------- 3 Muscle 0.529 ``` -------------------------------- ### Launching the EEG-BIDS Console Source: https://eegprep.org/user_guide/bids_workflow.html Start the console session to access BIDS import and export menu actions within a shared environment. ```bash uv run eegprep-console --full ``` -------------------------------- ### Example Interpolation Quality Output Source: https://eegprep.org/auto_examples/plot_channel_interpolation.html Sample console output showing variance statistics for bad and good channels. ```text ====================================================================== INTERPOLATION QUALITY ASSESSMENT ====================================================================== Bad Channel Statistics: ---------------------------------------------------------------------- Channel Original Var Interp Var Var Change ---------------------------------------------------------------------- Fz 2615.38 18.34 -99.3 % Pz 0.01 16.86 167841.9 % Fc1 1211.56 1211.56 0.0 % Good Channel Statistics (for reference): ---------------------------------------------------------------------- Channel Original Var Interp Var Var Change ---------------------------------------------------------------------- Fp1 53.70 53.70 0.0 % Fpz 54.17 54.17 0.0 % Fp2 54.20 54.20 0.0 % F7 54.17 54.17 0.0 % F3 54.12 54.12 0.0 % ``` -------------------------------- ### Install MNE-Python Source: https://eegprep.org/user_guide/mne_integration.html Ensure MNE-Python is installed in your environment for EEGPrep integration. ```bash uv add mne ``` -------------------------------- ### Install package in editable mode Source: https://eegprep.org/development.html Resolve ModuleNotFoundError by installing dependencies. ```bash uv sync --group dev ``` -------------------------------- ### Initialize and Precompute STUDY in Python Source: https://eegprep.org/user_guide/study_workflows.html Demonstrates loading datasets, assigning metadata, and performing channel measure precomputation using the EEGPrep Python API. ```python from pathlib import Path from eegprep import pop_loadset, pop_precomp, pop_study ALLEEG = [ pop_loadset(Path("sample_data") / "eeglab_data_epochs_ica.set"), pop_loadset(Path("sample_data") / "eeglab_data_epochs_ica.set"), ] for index, EEG in enumerate(ALLEEG, start=1): EEG["subject"] = f"S{index:02d}" EEG["condition"] = "tutorial" STUDY, ALLEEG, com = pop_study(None, ALLEEG, name="Tutorial study", return_com=True) STUDY, ALLEEG, com = pop_precomp(STUDY, ALLEEG, "channels", erp="on", return_com=True) ``` -------------------------------- ### Launch EEGPrep without plugins Source: https://eegprep.org/user_guide/extensions.html Use these commands to troubleshoot startup issues or restrict the session to core functionality. ```bash uv run eegprep-gui --no-plugins uv run eegprep-console --no-plugins ``` -------------------------------- ### Build Alternative Documentation Formats Source: https://eegprep.org/development.html Commands to generate PDF or EPUB documentation. ```bash uv run make -C docs latexpdf ``` ```bash uv run make -C docs epub ``` -------------------------------- ### Install eegprep using pip Source: https://eegprep.org/user_guide/installation.html Use this command for installing the package in environments where uv is not used. ```bash pip install eegprep ``` -------------------------------- ### Initialize Environment and Imports Source: https://eegprep.org/_downloads/5b37628fc88781e07fe6fd42065f3c08/plot_bids_pipeline.ipynb Sets up the necessary environment, imports required libraries, and configures the random seed for reproducibility. ```python import numpy as np import tempfile import os import json import sys import shutil sys.path.insert(0, '/Users/baristim/Projects/eegprep/src') import eegprep # Set random seed for reproducibility np.random.seed(42) ``` -------------------------------- ### Build documentation locally Source: https://eegprep.org/user_guide/installation.html Commands to sync development dependencies and build the documentation using Sphinx. ```bash uv sync --group dev --extra docs uv run --no-sync sphinx-build -b html docs/source docs/_build/html ``` ```bash uv run --no-sync make -C docs html ``` -------------------------------- ### ICLabel Classification Output Example Source: https://eegprep.org/auto_examples/plot_ica_and_iclabel.html Example output showing the classification results for 20 components. ```text Running ICLabel classification... ---------------------------------------------------------------------- ICLabel classification complete! Number of components classified: 20 Number of classes: 7 Component Classifications (first 10): ---------------------------------------------------------------------- Comp Class Confidence Probabilities ---------------------------------------------------------------------- 0 Line Noise 0.497 [0.24, 0.06, 0.08, ...] 1 Channel Noise 0.394 [0.12, 0.17, 0.00, ...] 2 Eye 0.346 [0.13, 0.15, 0.35, ...] 3 Muscle 0.529 [0.17, 0.53, 0.06, ...] 4 Eye 0.343 [0.05, 0.04, 0.34, ...] 5 Brain 0.440 [0.44, 0.10, 0.02, ...] 6 Other 0.449 [0.07, 0.24, 0.14, ...] 7 Muscle 0.405 [0.06, 0.40, 0.17, ...] 8 Brain 0.451 [0.45, 0.02, 0.04, ...] 9 Eye 0.369 [0.01, 0.23, 0.37, ...] ... and 10 more components ``` -------------------------------- ### Build documentation locally Source: https://eegprep.org/contributing.html Generate the project documentation locally to verify formatting and content updates. ```bash cd docs make html ``` -------------------------------- ### Inspect Installed Plugin Metadata Source: https://eegprep.org/user_guide/plugins.html Retrieve and display information about currently installed plugins and their menu structures. ```python import eegprep for plugin in eegprep.bundled_plugins(): print(plugin["plugin"], plugin["funcname"], plugin["menu"]) status, names, records = eegprep.plugin_status("ICLabel", exactmatch=True) print(status, names) inventory = eegprep.plugin_menu(show=False) print(eegprep.format_plugin_menu()) ``` -------------------------------- ### ICA Decomposition Output Example Source: https://eegprep.org/auto_examples/plot_ica_and_iclabel.html Example output showing the result of the ICA decomposition process, including error handling messages. ```text Performing ICA decomposition using Picard algorithm... ---------------------------------------------------------------------- Note: ICA decomposition encountered an issue: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices Using dummy components for demonstration... ``` -------------------------------- ### Create virtual environment for eegprep Source: https://eegprep.org/user_guide/installation.html Set up a clean virtual environment to avoid dependency conflicts. ```bash uv venv eegprep_env source eegprep_env/bin/activate # On Windows: eegprep_env\Scripts\activate uv pip install eegprep ``` -------------------------------- ### eegprep.CatalogValidationOptions.entry_points_provider Source: https://eegprep.org/api/generated/eegprep.CatalogValidationOptions.html Retrieves EntryPoint objects for installed packages. ```APIDOC ## entry_points_provider() ### Description Returns EntryPoint objects for all installed packages. Users can pass selection parameters to filter results. ### Returns - **result** (EntryPoints | SelectableGroups) - The entry points or selectable groups for installed packages. ``` -------------------------------- ### eegprep.plugin_status Source: https://eegprep.org/api/index.html Checks the installation status of a specific EEGPrep extension. ```APIDOC ## eegprep.plugin_status(pluginname, *[, ...]) ### Description Return EEGLAB-style installed status for EEGPrep extensions. ### Parameters - **pluginname** (str) - Required - The name of the plugin to check. ``` -------------------------------- ### eegprep.bundled_plugins() Source: https://eegprep.org/api/generated/eegprep.bundled_plugins.html Retrieves metadata for all EEGPrep extensions bundled with the current installation. ```APIDOC ## eegprep.bundled_plugins() ### Description Returns metadata for EEGPrep extensions bundled in the installed package. ### Signature `eegprep.bundled_plugins() -> tuple[dict[str, Any], ...]` ### Returns - **tuple[dict[str, Any], ...]**: A tuple containing dictionaries of metadata for each bundled plugin. ``` -------------------------------- ### Clone and Configure Repository Source: https://eegprep.org/contributing.html Initial steps to clone a fork and link the upstream repository. ```bash git clone https://github.com/YOUR_USERNAME/eegprep.git cd eegprep ``` ```bash git remote add upstream https://github.com/sccn/eegprep.git ``` ```bash git checkout -b feature/your-feature-name ``` -------------------------------- ### Check CUDA and PyTorch status Source: https://eegprep.org/user_guide/installation.html Verify GPU availability and PyTorch installation. ```bash nvidia-smi ``` ```python import torch print(torch.cuda.is_available()) ``` -------------------------------- ### View Documentation Locally Source: https://eegprep.org/development.html Commands to open the generated documentation in a browser or serve it via a local HTTP server. ```bash open docs/build/html/index.html # macOS xdg-open docs/build/html/index.html # Linux start docs/build/html/index.html # Windows ``` ```bash cd docs/build/html uv run python -m http.server 8000 ``` -------------------------------- ### eegprep.plugin_status Source: https://eegprep.org/api/core.html Checks the installation status of EEGPrep extensions using EEGLAB-style matching. ```APIDOC ## eegprep.plugin_status(pluginname, *, exactmatch=False, pluginlist=None, registry=None, catalog=None, catalog_path=None, include_bundled=True, include_entry_points=True, disabled_extensions=None) ### Description Returns the installed status for EEGPrep extensions based on the provided name or search criteria. ### Parameters - **pluginname** (str) - Plugin or extension name, package name, or substring to search. - **exactmatch** (bool) - Require exact case-insensitive name matching. - **pluginlist** (list[dict[str, Any]] | tuple[dict[str, Any], ...] | None) - Optional precomputed extension inventory. - **registry** (ExtensionRegistry | None) - Optional discovered registry. - **catalog** (ExtensionCatalog | None) - Optional loaded catalog. - **catalog_path** (str | None) - Optional JSON catalog path. - **include_bundled** (bool) - Include bundled EEGPrep plugin ports. - **include_entry_points** (bool) - Include installed entry-point extensions. - **disabled_extensions** (set[str] | list[str] | tuple[str, ...] | None) - Registry names to mark disabled. ### Returns - **tuple[list[int], list[str], list[dict[str, Any]]]** - A tuple containing status codes (1 for active, 0 otherwise), extension names, and plugin structures. ``` -------------------------------- ### eegprep.ExtensionRegistry.__init__ Source: https://eegprep.org/api/generated/eegprep.ExtensionRegistry.html Initializes the ExtensionRegistry with configuration for extension discovery. ```APIDOC ## eegprep.ExtensionRegistry.__init__ ### Description Initializes a new instance of the ExtensionRegistry to manage EEGPrep extensions. ### Parameters - **disabled_extensions** (set[str]|list[str]|tuple[str]) - Optional - A collection of extension names to disable. - **include_bundled** (bool) - Optional - Whether to include bundled extensions. - **include_entry_points** (bool) - Optional - Whether to include entry point extensions. - **entry_point_group** (str) - Optional - The entry point group name. - **entry_points_provider** (Callable) - Optional - Provider for entry points. - **current_version** (str|None) - Optional - The current version string. - **version_provider** (Callable) - Optional - Provider for version information. ``` -------------------------------- ### Build HTML Documentation Source: https://eegprep.org/development.html Commands to sync dependencies and build HTML documentation using Sphinx. ```bash uv sync --group dev --extra docs uv run --no-sync sphinx-build -b html docs/source docs/_build/html ``` ```bash uv run make -C docs html ``` -------------------------------- ### eegprep.format_plugin_menu(pluginlist=None, *, registry=None, catalog=None, catalog_path=None, include_bundled=True, include_entry_points=True, disabled_extensions=None) Source: https://eegprep.org/api/generated/eegprep.format_plugin_menu.html Returns a plain-text extension inventory for console display. ```APIDOC ## eegprep.format_plugin_menu ### Description Returns a plain-text extension inventory for console display. ### Parameters - **pluginlist** (list[dict[str, Any]] | tuple[dict[str, Any], ...] | None) - Optional - A list or tuple of plugin dictionaries. - **registry** (ExtensionRegistry | None) - Optional - An instance of ExtensionRegistry. - **catalog** (ExtensionCatalog | None) - Optional - An instance of ExtensionCatalog. - **catalog_path** (str | None) - Optional - Path to the extension catalog. - **include_bundled** (bool) - Optional - Whether to include bundled extensions (default: True). - **include_entry_points** (bool) - Optional - Whether to include entry points (default: True). - **disabled_extensions** (set[str] | list[str] | tuple[str, ...] | None) - Optional - A collection of disabled extension names. ### Returns - **str** - A plain-text representation of the extension inventory. ``` -------------------------------- ### Accessing CLI Help Source: https://eegprep.org/user_guide/agent_cli.html Retrieve general help and specific skill information for the EEGPrep CLI. ```bash eegprep --help eegprep skills get eegprep-cli ``` -------------------------------- ### Check Python Version Source: https://eegprep.org/development.html Verify that the installed Python version meets the minimum requirement of 3.11. ```bash python --version ``` -------------------------------- ### BIDS EEG Dataset Structure Source: https://eegprep.org/user_guide/bids_workflow.html Example of a standard BIDS-compliant directory layout for EEG data. ```text dataset/ |-- dataset_description.json |-- participants.tsv `-- sub-01/ `-- eeg/ |-- sub-01_task-rest_run-01_eeg.set |-- sub-01_task-rest_run-01_eeg.fdt |-- sub-01_task-rest_run-01_channels.tsv |-- sub-01_task-rest_run-01_events.tsv `-- sub-01_task-rest_run-01_eeg.json ``` -------------------------------- ### ICA Component Summary Output Source: https://eegprep.org/auto_examples/plot_ica_and_iclabel.html Example output showing the distribution of classified ICA components. ```text ====================================================================== SUMMARY ====================================================================== Total components: 20 Brain components: 4 Muscle components: 5 Eye components: 3 Heart components: 3 Line noise components: 1 Channel noise components: 2 Other components: 2 Artifact components: 1 Percentage of artifacts: 5.0% ====================================================================== ``` -------------------------------- ### eegprep.ExtensionMenu.__init__ Source: https://eegprep.org/api/generated/eegprep.ExtensionMenu.html Initializes a new instance of the ExtensionMenu class with specified menu properties. ```APIDOC ## ExtensionMenu.__init__ ### Description Initializes a declarative menu contribution for an extension action. ### Parameters - **path** (tuple[str, ...]) - Optional - The path for the menu item. - **action** (str) - Optional - The action associated with the menu item. - **label** (str) - Optional - The display label for the menu item. - **tag** (str) - Optional - A tag for the menu item. - **userdata** (str) - Optional - User-defined data associated with the menu item. - **separator** (bool) - Optional - Whether the item acts as a separator. - **enabled** (bool) - Optional - Whether the menu item is enabled. - **checked** (bool) - Optional - Whether the menu item is checked. - **visibility** (str) - Optional - The visibility state of the menu item. - **insert_after** (str) - Optional - Identifier to insert this item after. - **insert_before** (str) - Optional - Identifier to insert this item before. - **children** (tuple[ExtensionMenu, ...]) - Optional - Child menu items. ``` -------------------------------- ### Example Output of Preprocessing Statistics Source: https://eegprep.org/auto_examples/plot_basic_preprocessing.html The expected console output format for the preprocessing summary statistics. ```text ====================================================================== PREPROCESSING SUMMARY STATISTICS ====================================================================== Metric Original Cleaned Interpolated ---------------------------------------------------------------------- Mean (µV) 0.019 -0.012 -0.014 Std Dev (µV) 7.450 2.075 2.026 Variance (µV²) 55.497 4.307 4.106 Variance Reduction 92.2% 92.6% Total channels 32 Bad channels identified 2 Percentage bad 6.2% ====================================================================== ``` -------------------------------- ### Google-style docstring format Source: https://eegprep.org/contributing.html Standard structure for function documentation including parameters, returns, and examples. ```python def preprocess_eeg(eeg, filter_type='bandpass', freq_range=(1, 50)): """Preprocess EEG data with filtering and artifact removal. This function applies a series of preprocessing steps to clean EEG data for further analysis. Parameters ---------- eeg : EEGobj The EEG object to preprocess. filter_type : str, optional Type of filter to apply. Options: 'bandpass', 'highpass', 'lowpass'. Default is 'bandpass'. freq_range : tuple, optional Frequency range for filtering in Hz. Default is (1, 50). Returns ------- dict The preprocessed EEG dictionary. Raises ------ ValueError If filter_type is not recognized. TypeError If eeg is not an EEG dictionary. Examples -------- >>> from eegprep import pop_eegfiltnew, pop_loadset >>> EEG = pop_loadset("data.set") >>> EEG, com = pop_eegfiltnew(EEG, locutoff=1, hicutoff=50, return_com=True) Notes ----- This function returns the updated EEG dictionary. See Also -------- clean_artifacts : Remove artifacts from EEG data clean_flatlines : Remove flat-line channels """ # Implementation here pass ``` -------------------------------- ### Example output for clean_artifacts Source: https://eegprep.org/auto_examples/plot_artifact_removal.html Displays the expected console output after running the artifact removal process. ```text ====================================================================== METHOD 1: clean_artifacts ====================================================================== Description: General-purpose artifact removal Removes high-amplitude transient artifacts Good for: Eye blinks, muscle artifacts, transient noise Result: Data range [-18.10, 23.38] µV ``` -------------------------------- ### Configure browser display settings Source: https://eegprep.org/user_guide/eegbrowser.html Use the show=False parameter to initialize the browser model without opening the Qt interface, useful for scripting or testing. ```python model = eegplot(EEG, winlength=5, dispchans=16, show=False) ``` -------------------------------- ### Check EEGPrep version in Python Source: https://eegprep.org/changelog.html Import the package and print the version attribute to verify the current installation. ```python import eegprep print(eegprep.__version__) ``` -------------------------------- ### Load Sample Data Source: https://eegprep.org/user_guide/preprocessing_pipeline.html Initializes the EEG dataset from a file path and verifies basic data properties. ```python from pathlib import Path from eegprep import pop_loadset EEG = pop_loadset(Path("sample_data") / "eeglab_data.set") print(EEG["data"].shape, EEG["srate"], len(EEG["event"])) ``` -------------------------------- ### Create a STUDY via Console Source: https://eegprep.org/user_guide/gui_tutorials.html Programmatically initialize a STUDY object using currently loaded datasets in ALLEEG. ```matlab STUDY, ALLEEG, com = pop_study(None, ALLEEG, name="Tutorial study", return_com=True) ``` -------------------------------- ### Bad Channel Simulation Output Source: https://eegprep.org/auto_examples/plot_channel_interpolation.html Example console output showing the status of introduced bad channels. ```text Introducing bad channels... ---------------------------------------------------------------------- Bad channels to introduce: ['Fz', 'Pz', 'Fc1'] Type 1: High noise channel (Fz) - Adding 50 µV noise (vs. typical 2 µV) Type 2: Flat/dead channel (Pz) - Replacing signal with minimal noise Type 3: Noisy channel with artifacts (Fc1) - Adding 30 µV noise + 50 Hz artifact Bad channels introduced at indices: [5, 15, 25] ====================================================================== ``` -------------------------------- ### Configure entry points in pyproject.toml Source: https://eegprep.org/api/extensions.html Advertise the register function via standard Python package metadata. ```toml [project.entry-points."eegprep.extensions"] my_extension = "my_extension.register:register" ```