API Reference#
This section contains the complete API documentation for eegprep. The API is organized into logical modules covering core functionality, preprocessing, independent component analysis, signal processing, input/output operations, and utility functions.
- Core Functions and Classes
- Preprocessing Functions
- Independent Component Analysis
- Signal Processing Functions
- Statistics Functions
- Input/Output Functions
- Interactive Pop Workflow API
- Extension SDK and Registry
- Minimal extension entry point
- Status model
- Catalog and Governance
- Author Test Harness
- Extension Manager and catalog
- Authoring examples
- API Reference
- Utility Functions
Core Classes#
|
Wrapper class for EEG datasets stored as dictionaries. |
|
EEGLAB-like GUI state without module globals. |
Interactive GUI and Console#
|
Start the EEGPrep GUI. |
|
Start the EEGPrep EEGLAB-style main window. |
|
Synchronize an IPython namespace with an |
|
Compact, unpackable result for EEGPrep console |
|
Compact, unpackable result for dataset-list |
|
Render a dialog spec and return tagged values, or |
|
Open an EEGLAB-like list selector. |
|
Open an EEGLAB-like help browser for a function. |
|
Complete EEGLAB-like dialog specification. |
|
Single EEGLAB-like GUI control. |
|
Declarative callback metadata for a GUI control. |
Dataset Workspace Helpers#
Return an empty EEG dictionary with EEGLAB core fields. |
|
|
Store EEG in |
|
Return dataset(s) from |
|
Store or retrieve datasets following EEGLAB's |
|
Delete dataset indices from |
|
Update EEGPrep's EEGLAB-compatible options dictionary. |
GUI and Session Entry Points#
|
Select multiple datasets in |
Data Loading and Saving#
|
Load EEGLAB dataset from .set or .mat file. |
|
Load EEGLAB dataset from file (alias for pop_loadset). |
|
Load EEG data from HDF5 file. |
|
Save EEG data to file. |
|
Load an EEG data file of a supported format from a BIDS dataset. |
Preprocessing Functions#
Artifact Removal#
|
All-in-one artifact removal, port of MATLAB clean_artifacts. |
|
Run the Artifact Subspace Reconstruction (ASR) method on EEG data. |
|
Remove (near-) flat-lined channels. |
|
Remove drifts from the data using a forward-backward high-pass filter. |
|
Remove periods with abnormally high-power content from continuous data. |
|
Compare a cleaned dataset against its original clean_rawdata source. |
|
Return clean_rawdata sample/channel rejection diagnostics. |
Channel Operations#
|
Remove channels with problematic data from a continuous data set. |
|
Remove channels with abnormal data from a continuous data set. |
|
Interpolate missing or bad EEG channels using spherical spline. |
|
Interpolate EEG channels using EEGLAB |
|
Convert an EEG dataset to average or common-reference data. |
Signal Processing#
|
Resample EEG data to a new sampling rate. |
|
Filter EEG data using EEGLAB's Hamming-windowed FIR defaults. |
|
Filter EEG data using a windowed-sinc FIR filter. |
|
Filter EEG data using a Parks-McClellan equiripple FIR filter. |
|
Filter EEG data using a moving-average FIR filter. |
|
Estimate Kaiser window beta from passband ripple. |
|
Estimate a windowed-sinc FIR order. |
|
Estimate Parks-McClellan FIR order and pass/stop weights. |
|
Design a FIRFilt windowed-sinc FIR and optionally export an |
|
Return an EEGLAB-style FIR filter report. |
|
Plot impulse, step, magnitude, and phase response like FIRFilt. |
|
Perform ICA decomposition using AMICA (Adaptive Mixture ICA). |
|
Perform ICA decomposition using Picard algorithm. |
|
Perform ICA decomposition using runica (infomax) algorithm. |
Independent Component Analysis#
|
Apply ICLabel to classify independent components. |
|
Extract features for ICLabel classification. |
Spectral Analysis#
|
Compute relative power spectral density for ICA components. |
|
Compute autocorrelation of ICA components. |
|
Compute autocorrelation of EEG ICA components using Welch method. |
|
Compute autocorrelation of EEG ICA components using FFT. |
|
Compute an EEGLAB-like ERSP/ITC time-frequency decomposition. |
|
Compute an EEGLAB-like event-related coherence decomposition. |
|
Return EEGLAB-like spectral estimates for each trial. |
|
Compute legacy |
|
Compute legacy |
|
Compute phase-amplitude coupling from epoched signals. |
|
Compute sliding-window phase-amplitude coupling from continuous data. |
|
Return the linear interpolation matrix that warps event latencies. |
|
Warp an angular time series and wrap results to |
|
Calculate Morlet wavelet cycles from temporal or spectral width. |
|
Apply EEGLAB average baseline correction to absolute power. |
|
Apply trial-level divisive or standardized baseline correction. |
|
Compute EEGLAB-style inter-trial coherence. |
|
Return the display unit implied by |
|
Accumulate surrogate statistics and return EEGLAB-style thresholds. |
|
Estimate an EEGLAB-style multiple-comparison correction count. |
|
Return a gamma-fit corrected p-value and fitted parameters. |
|
Return |
|
Return a Ramberg-Schmeiser fitted p-value for |
|
Return the fitted Ramberg-Schmeiser cumulative probability at |
|
Return the Ramberg-Schmeiser moment residual for |
|
Return the absolute quantile residual for one probability value. |
|
Compute EEGLAB-style summary statistics for a real-valued signal. |
|
Plot a channel or component ERSP/ITC decomposition. |
|
Plot event-related channel/component cross-coherence. |
|
Run legacy |
|
Run legacy |
|
Compute and plot statistics for one channel or component. |
|
Compute and plot statistics for numeric EEG event fields. |
Epoching and Selection#
|
Adjust event offset of all or selected events. |
|
Extract data epochs time locked to event types or event indices. |
|
Select EEG data using EEGLAB |
|
Reject EEG data segments specified by regions. |
|
Remove [beg end] sample ranges (1-based, inclusive) from continuous data and update events. |
Visualization#
|
Convert XYZ Cartesian coordinates to polar |
|
Open an EEGLAB-style scrolling browser for channel-major EEG data. |
|
Open |
|
Plot EEGLAB-style 2-D scalp maps for ERP latencies or ICA components. |
|
Plot a 2D topographic map of EEG data. |
Format Conversion#
|
Convert MNE Raw object to EEG data structure. |
|
Convert MNE epochs with ICA to EEGLAB dataset format. |
|
Convert EEG data structure to MNE Raw object. |
Utilities#
|
Validate and set up EEG dataset structure. |
|
Compare two EEG-like structures (or arrays) and return a difference summary. |
|
Resolve channel identifiers to 0-based indices and labels. |
|
Convert latencies in time units (relative to per-epoch time 0) to latencies in data points assuming concatenated epochs (EEGLAB style). |
|
Convert event latencies in data points to latencies in time units (default seconds). |
BIDS Pipeline#
|
Apply data cleaning to EEG files in a BIDS dataset. |
|
Return a list of all EEG raw-data files in a BIDS dataset. |
|
Load one or more EEG files from a BIDS dataset. |
|
Export EEG dataset(s) as BIDS-like EEGLAB files and sidecars. |
Bundled Plugins#
EEGPrep exposes metadata for bundled in-repo plugin ports. External EEGLAB plugin install/update/remove workflows are intentionally outside the public API for now.
Return metadata for EEGPrep extensions bundled in the installed package. |
|
|
Return EEGLAB-style installed status for EEGPrep extensions. |
|
Show or return the EEGPrep Extension Manager inventory. |
|
Return a plain-text extension inventory for console display. |
|
Clean continuous EEG data using the clean_rawdata workflow. |
|
Return and optionally print ICLabel class statistics. |
|
Classify independent components using ICLabel. |
|
Flag ICLabel-classified components for later rejection. |
|
Render the EEGLAB viewprops-style extended property dashboard. |
|
Render channel/component property overview figures and activity views. |
|
Designs windowed sinc type I linear phase FIR filter. |
|
Estimate windowed sinc FIR filter order depending on window type and requested transition band width. |
|
Configure DIPFIT settings without requiring an EEGLAB runtime. |
|
Plot localized DIPFIT component positions. |
|
Validate headmodel inputs, then fail clearly until FieldTrip is ported. |
|
Run a standalone spherical coarse grid search for ICA components. |
|
Run standalone nonlinear dipole refinement for one component. |
|
Fit multiple ICA components using grid search and nonlinear refinement. |
|
Compute a standalone spherical leadfield for explicit source points. |
|
Validate LORETA prerequisites, then fail clearly until a backend exists. |
Extension SDK#
EEGPrep external extensions are Python packages discovered through the
eegprep.extensions entry-point group. The registry validates declarative
specs and keeps extension callables lazy until a later runtime surface uses
them.
int([x]) -> integer int(x, base=10) -> integer |
|
|
One catalog metadata validation issue. |
Validation switches for local and future catalog-CI checks. |
|
|
Catalog validation result with blocking errors and non-blocking warnings. |
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
|
Declarative metadata returned by an |
|
Discover, validate, and report EEGPrep extensions. |
|
A discovered extension plus status and validation details. |
|
Registry status for an extension record. |
|
Source category declared by an extension. |
|
Loaded extension catalog plus source diagnostics. |
|
Curated metadata for an EEGPrep extension, without bundled code. |
|
Install/source categories accepted by the curated catalog. |
|
Declarative action contributed by an extension. |
|
Declarative |
|
Declarative menu contribution for an extension action. |
|
Python distribution required by an extension. |
|
Packaged resource declared by an extension. |
Raised when a lazily referenced extension object cannot be loaded. |
|
Validation errors grouped by registry status category. |
|
Assertion helper for extension author test suites. |
|
|
Reference to an object that should be imported only when used. |
Assert that an |
|
Check extension API, EEGPrep version, and dependency compatibility. |
|
|
Discover EEGPrep extensions with the default registry settings. |
|
Return whether |
Load catalog entries from a JSON file or a directory of JSON files. |
|
|
Validate catalog metadata entries. |
|
Validate catalog metadata loaded from |
|
Validate an extension spec without importing its lazy action targets. |
|
Load the packaged or local metadata-only extension catalog. |
Return copyable install commands for a catalog entry without executing them. |
|
Return copyable update commands for a catalog entry without executing them. |
STUDY Workflows#
The STUDY wrappers and helpers below cover the integrated standalone STUDY workflow: metadata/design creation, study load/save, measure precompute, measure plotting, component preclustering, clustering, and cluster editing.
|
Create or edit a STUDY structure from loaded EEG datasets. |
|
Load selected datasets and create a STUDY. |
|
Create a STUDY marked as a simple ERP design. |
|
Load a STUDY JSON file saved by |
|
Save a STUDY structure as an EEGPrep JSON |
|
Return |
|
Attach one imported variable value per STUDY subject. |
|
Return factor descriptors for one STUDY or design structure. |
|
Precompute STUDY channel or component measures. |
|
Plot precomputed STUDY channel or component measures. |
|
Prepare a STUDY component clustering matrix. |
|
Run deterministic k-means clustering on |
|
Run cluster edit and plotting actions on |
|
Return |
|
Build a design matrix from a STUDY design and trial metadata. |
|
Create LIMO-compatible categorical and continuous design matrices. |
|
Check whether each value of a STUDY factor has the same subject count. |
|
Return 1 when a design has no continuous variables or multi-valued extras. |
|
Return trial rows enriched with selected |
|
Group 1-based dataset indices with near-identical ICA weights*sphere. |
|
Return STUDY factor names, values, subject groupings, and pairing flags. |
|
Return 1-based trial indices matching all requested trialinfo values. |
|
Return 1-based indices where an independent-variable value matches. |
|
Populate |
|
Remove datasets from STUDY/ALLEEG and return removed 1-based indices. |
|
Return STUDY without cached measure/data fields for the requested target. |
|
Refresh STUDY design variables after dataset metadata changes. |
|
Save factor descriptors under |
|
Return selected 1-based dataset indices and trial indices. |
|
Return cached-measure cells with only the requested subject columns. |
|
Return a STUDY/ALLEEG subset using EEGLAB-facing 1-based selectors. |
|
Read precomputed STUDY measures from EEGPrep's in-memory cache. |
|
Read cached STUDY ERP measures. |
|
Read cached STUDY spectrum measures. |
|
Read cached STUDY ERSP measures. |
|
Read cached STUDY ITC measures. |
|
Read cached STUDY component scalp topographies. |
|
Read EEGPrep-owned cached STUDY PAC data when present. |
|
Compute phase-amplitude coupling for an EEG dataset or STUDY. |
|
Read and optionally plot precomputed STUDY PAC measures. |
|
Prepare a FieldTrip-like neighbor list and LIMO adjacency matrix. |
|
Interpolate selected missing channels into every STUDY dataset. |
|
Report the standalone boundary for STUDY-level source plotting. |
|
Report the standalone boundary for STUDY dipole-cluster workflows. |
|
Check loaded STUDY data and cached measures for standalone EEGPrep. |
|
Check dataset/session alignment for a STUDY and loaded ALLEEG. |
|
Return |
|
Return |
|
Read and plot precomputed STUDY ERP measures. |
|
Read and plot precomputed STUDY spectrum measures. |
|
Read and plot precomputed STUDY ERSP measures. |
|
Read and plot precomputed STUDY ITC measures. |
|
Run k-means for a range and choose the best silhouette score. |
|
Cluster rows and iteratively mark distant rows as outliers. |
|
Cluster rows using deterministic affinity propagation updates. |
|
Return centroids for all rows or for each positive label. |
|
Return 1-based row indices farther than |