Input/Output Functions#

This section documents the input/output functions for loading and saving EEG data in various formats.

BIDS Loading#

eegprep.pop_load_frombids(filename, *, bidsmetadata=True, bidschanloc=True, bidsevent='replace', eventtype=None, infer_locations=None, dtype=<class 'numpy.float32'>, numeric_null=array([], dtype=float64), return_report=False, verbose=True)

Load an EEG data file of a supported format from a BIDS dataset.

Supported formats are EDF, BrainVision, EEGLAB SET, BDF.

Parameters#

filenamestr

Path to the EEG data file in a BIDS dataset.

bidsmetadatabool

Whether to override any metadata in the EEG file with metadata from BIDS.

bidschanlocbool

Whether to override any channel information (incl. locations) in the EEG file with channel information from BIDS.

bidseventbool or str

Whether to load in and override any event data in the EEG file with event data from BIDS. Can be one of the following:

  • "replace"/True: replace events from EEG file with those from the BIDS event file.

  • "merge": selectively override events from EEG file with those from the BIDS event file.

  • "append": append events from the BIDS event file to those from the EEG file. This mode can result in duplicate events; use with caution.

  • False/None: do not load events from BIDS; keep those from the EEG file.

eventtypestr or None

Optionally the column name in the BIDS events file to use for event types; if not set, will be inferred heuristically.

infer_locationsbool or str or None

Whether to infer channel locations if necessary from the channel labels (if 10-20 labeling system).

  • True: infer locations from channel labels and override existing locations if any.

  • False: leave locations as-is, even if missing.

  • None: infer only if no channels have locations.

  • str: filename of a locations file to infer locations from. See files in resources/montages; this can disambiguate alternative montages that use the same naming system.

dtypenp.dtype

The data type to use for the EEG data.

numeric_nullAny

The value to use for empty numeric fields in the EEG data.

The default is np.array([]) for MATLAB/pop_loadset compatibility.

return_reportbool

whether to return an import report dictionary as a second output

verbosebool

whether to log verbose output

Returns#

EEGdict

A dictionary containing the EEG data and metadata.

Reportdict, optional

optionally the import report to return, if desired.

Parameters:
Return type:

Dict[str, Any] | Tuple[Dict[str, Any], Dict[str, Any]]

eegprep.pop_importbids(path, *, return_com=False, **kwargs)

Load one or more EEG files from a BIDS dataset.

Parameters:
Return type:

dict[str, Any] | list[dict[str, Any]] | tuple[dict[str, Any] | list[dict[str, Any]], str]

eegprep.pop_exportbids(EEG, output_dir, *, subject='01', task='eeg', return_com=False)

Export EEG dataset(s) as BIDS-like EEGLAB files and sidecars.

Parameters:
Return type:

str | tuple[str, str]

Generic Import#

eegprep.pop_importdata(*args, return_com=False, **kwargs)

Import data from an array or supported file into an EEG dataset.

Parameters:
Return type:

dict[str, Any] | tuple[dict[str, Any], str]

eegprep.pop_fileio(filename, *, return_com=False, **kwargs)

Import a supported EEG data file with MNE/File-IO-style readers.

Parameters:
Return type:

dict[str, Any] | tuple[dict[str, Any], str]

eegprep.pop_biosig(filename, *, return_com=False, **kwargs)

Import BIOSIG-style EDF/BDF/GDF files.

Parameters:
Return type:

dict[str, Any] | tuple[dict[str, Any], str]

eegprep.pop_importevent(EEG, *args, return_com=False, **kwargs)

Import events from a text table or record array.

Parameters:
Return type:

dict[str, Any] | tuple[dict[str, Any], str]

eegprep.pop_importepoch(EEG, filename=None, fieldlist=None, *args, return_com=False, **kwargs)

Import per-epoch metadata from a text table.

Parameters:
Return type:

dict[str, Any] | tuple[dict[str, Any], str]

eegprep.pop_chanevent(EEG, chan, *args, return_com=False, **kwargs)

Import events from rising, falling, or both edges of data channels.

Parameters:
Return type:

dict[str, Any] | tuple[dict[str, Any], str]

eegprep.pop_importpres(EEG, filename=None, *, return_com=False, **kwargs)

Import a Presentation LOG file using EEGPrep’s generic event importer.

Parameters:
Return type:

dict[str, Any] | tuple[dict[str, Any], str]

eegprep.pop_importerplab(EEG, filename=None, *, return_com=False, **kwargs)

Import an ERPLAB-style event text file through the generic event importer.

Parameters:
Return type:

dict[str, Any] | tuple[dict[str, Any], str]

Channel Locations#

eegprep.pop_readlocs(filename=None, *args, return_com=False, **kwargs)

Read channel locations and return an EEGPrep chanlocs list.

Parameters:
Return type:

list[dict[str, Any]] | tuple[list[dict[str, Any]], str]

eegprep.pop_writelocs(chans, filename=None, *args, return_com=False, **kwargs)

Write channel locations and return a replayable history command.

Parameters:
Return type:

str

eegprep.readlocs(filename, *args, return_outputs=False, **kwargs)

Read a channel-location file or structure into EEGPrep dictionaries.

Parameters:
Return type:

Any

eegprep.writelocs(chans, filename, *args, **kwargs)

Write channel locations to an EEGLAB-compatible text file.

Parameters:
Return type:

None

eegprep.convertlocs(chans, command='auto', *args, verbose='off', **kwargs)

Return channel locations with requested coordinate fields filled in.

Parameters:
  • chans (Any) – EEG dictionary, channel-location dictionary, or channel-location sequence.

  • command (str) – EEGLAB conversion command such as "cart2all", "sph2topo", "topo2cart", or "auto".

  • *args (Any) – Optional EEGLAB-style key/value arguments. Only verbose is accepted for parity with EEGLAB.

  • verbose (str) – "on" or "off". Present for API parity.

  • **kwargs (Any) – Optional keyword arguments. Only verbose is accepted.

Returns:

A deep-copied object in the same broad shape as chans.

Return type:

Any

eegprep.chancenter(x, y, z, center=(0.0, 0.0, 0.0))

Return XYZ coordinates centered around a known or fitted sphere center.

Parameters:
Return type:

tuple[ndarray, ndarray, ndarray, ndarray, bool]

eegprep.pop_chancenter(chans, center=None, omitchans=None, *, gui=False, renderer=None, return_com=False)

Recenter channel locations using a known or optimized sphere center.

Parameters:
Return type:

Any

eegprep.pop_chancoresp(chans1, chans2, *args, return_com=False, **kwargs)

Return 1-based channel correspondences by label.

Parameters:
Return type:

Any

eegprep.readegilocs(EEG, fileloc=None)

Return EEG with EGI channel locations from packaged montages.

Parameters:
Return type:

dict[str, Any]

eegprep.readelp(filename)

Read a Polhemus .elp electrode-position file.

Parameters:

filename (str | Path)

Return type:

list[dict[str, Any]]

eegprep.readeetraklocs(filename)

Read a simple EETrak/ASA .elc location file.

Parameters:

filename (str | Path)

Return type:

list[dict[str, Any]]

Long-Tail Import Helpers#

eegprep.pop_loadbci(filename, srate=256.0, *, return_com=False)

Import a BCI2000-style file into an EEG dictionary.

Parameters:
Return type:

dict[str, Any] | tuple[dict[str, Any], str]

eegprep.pop_snapread(filename, gain=1.0, *, return_com=False)

Import a SnapMaster .SMA file.

Parameters:
Return type:

dict[str, Any] | tuple[dict[str, Any], str]

eegprep.snapread(filename, seekframes=0, *, event_channel=1, event_thresh=2.3)

Read a SnapMaster .SMA file into data, params, events, and header.

Parameters:
Return type:

tuple[ndarray, ndarray, ndarray, str]

eegprep.floatread(filename, size, format=None, offset=0)

Read a binary float32 matrix using MATLAB/EEGLAB column ordering.

Parameters:
Return type:

ndarray

eegprep.floatwrite(data, filename, format=None, transp='normal')

Write a matrix as float32 values using MATLAB/EEGLAB ordering.

Parameters:
Return type:

None

EEGLAB Format#

eegprep.pop_loadset(file_path=None, *args, loadmode='all', memmap=None, **kwargs)

Load EEGLAB dataset from .set or .mat file.

Parameters#

file_pathstr

Path to the EEGLAB .set file.

Returns#

dict

EEGLAB dataset dictionary.

eegprep.pop_loadset_h5(file_name)

Load EEG data from HDF5 file.

Parameters#

file_namestr

Path to the HDF5 file

Returns#

EEGdict

EEG data structure

eegprep.pop_saveset(EEG, file_name=None, *args, **kwargs)

Save EEG data to file.

Parameters#

EEGdict

EEG data.

file_namestr, optional

File name. EEGLAB-style filename/filepath/savemode keyword arguments are also accepted.

pop_saveset(..., savemode="twofiles") writes a .set header plus .fdt float32 sidecar. EEG_OPTIONS["option_savetwofiles"] uses that layout by default, and EEG_OPTIONS["option_memmapdata"] makes pop_loadset expose sidecar data through a NumPy-compatible memory map. See Large-Dataset Storage for storedisk session behavior and limitations.

Text And External Export#

eegprep.pop_export(EEG, filename, *args, **kwargs)

Export EEG data or ICA activity to a delimited text file.

Parameters:
Return type:

str

pop_export supports text export options including ICA export, time/electrode rows, transpose, ERP averaging, precision, separator, and a standalone numeric expr transform applied to the exported array x. Most expression function calls are positional; clip and nan_to_num also accept documented safe numeric keywords. Power operators require small constant exponents.

eegprep.pop_expica(EEG, filename, matrix='weights')

Export the ICA weight matrix or inverse weight matrix.

Parameters:
Return type:

str

eegprep.pop_expevents(EEG, filename)

Export EEG.event as a tab-delimited text file.

Parameters:
Return type:

str

eegprep.pop_writeeeg(EEG, filename, *args, **kwargs)

Write continuous EEG data to an EDF/BDF/GDF-compatible file.

Parameters:
Return type:

str

History And STUDY Files#

eegprep.pop_saveh(allcoms, filename='eegprephist.m', filepath='.')

Save dataset or session command history to a script file.

Parameters:
Return type:

str

eegprep.pop_runscript(filename, namespace=None)

Run a Python history script selected by the user.

The selected Python file is executed in-process; MATLAB .m scripts are not run by EEGPrep.

Parameters:
Return type:

str

eegprep.pop_study(STUDY=None, ALLEEG=None, *args, name=None, task=None, notes=None, design=None, commands=None, rmclust=None, gui=None, renderer=None, return_com=False, **kwargs)

Create or edit a STUDY structure from loaded EEG datasets.

Parameters:
Return type:

Any

eegprep.pop_studywizard(filenames, *, name='EEGPrep study', return_com=False)

Load selected datasets and create a STUDY.

Parameters:
Return type:

Any

eegprep.pop_studyerp(ALLEEG=None, *, return_com=False)

Create a STUDY marked as a simple ERP design.

Parameters:
Return type:

Any

eegprep.pop_studydesign(STUDY, ALLEEG, designind=None, *args, gui=None, renderer=None, return_com=False, **kwargs)

Edit STUDY designs and select the current design.

Parameters:
Return type:

Any

eegprep.pop_loadstudy(filename=None, *args, filepath=None, load_datasets=True, return_com=False, **kwargs)

Load a STUDY JSON file saved by pop_savestudy.

Parameters:
Return type:

Any

eegprep.pop_savestudy(STUDY, EEG=None, *args, filename=None, filepath=None, savemode=None, resavedatasets='off', return_com=False, **kwargs)

Save a STUDY structure as an EEGPrep JSON .study file.

Parameters:
Return type:

Any

eegprep.pop_precomp(STUDY, ALLEEG, chanorcomp='channels', *args, gui=None, renderer=None, return_com=False, **kwargs)

Precompute STUDY channel or component measures.

Parameters:
Return type:

Any

eegprep.pop_chanplot(STUDY=None, ALLEEG=None, *, channels=None, components=None, measure='erp', mode='channels', gui=False, renderer=None, return_com=False)

Plot precomputed STUDY channel or component measures.

Parameters:
eegprep.std_editset(STUDY, ALLEEG, *args, name=None, task=None, notes=None, filename=None, filepath=None, commands=None, updatedat='on', return_com=False, **kwargs)

Modify STUDY metadata and datasetinfo entries.

Parameters:
Return type:

Any

eegprep.std_checkset(STUDY, ALLEEG, *, return_com=False)

Normalize a STUDY dict and refresh dataset/design consistency metadata.

Parameters:
Return type:

Any

eegprep.std_checkdatasetinfo(STUDY, ALLEEG)

Return STUDY.datasetinfo consistency checks for loaded datasets.

Parameters:
Return type:

dict[str, Any]

eegprep.std_checkconsist(STUDY, *args, uniform=None, return_counts=False, **kwargs)

Check whether each value of a STUDY factor has the same subject count.

Parameters:
Return type:

Any

eegprep.std_checkdesign(STUDY, designind=None)

Return 1 when a design has no continuous variables or multi-valued extras.

Parameters:
Return type:

int

eegprep.std_makedesign(STUDY, ALLEEG, designind=1, *args, name=None, variable1=None, values1=None, vartype1='categorical', variable2=None, values2=None, vartype2='categorical', variable3=None, values3=None, vartype3='categorical', variable4=None, values4=None, vartype4='categorical', subjselect=None, filepath='', datselect=None, delfiles='off', defaultdesign='on', return_com=False, **kwargs)

Create or replace a 1-based STUDY design.

Design metadata and factor selections are stored. delfiles controls cached measure arrays: 'on' or 'limited' clear them on the design change, while 'off' preserves any precomputed changrp/cluster measures attached to the redefined design.

Parameters:
Return type:

Any

eegprep.std_addvarlevel(STUDY, designind=None)

Return STUDY with one/two design-variable levels.

EEGLAB marks variables from per-trial metadata as first-level ("one") and stable dataset/subject metadata as second-level ("two"). Dataset metadata that changes within one subject is first-level because it cannot be modeled as an inter-subject factor.

Parameters:
Return type:

dict[str, Any]

eegprep.std_builddesignmat(design, trialinfo, expanding=False)

Build a design matrix from a STUDY design and trial metadata.

The output mirrors EEGLAB’s helper: categorical factors are encoded as 1-based level numbers, continuous factors keep their numeric values, and a constant column is appended at the end.

Parameters:
Return type:

tuple[ndarray, list[str], ndarray]

eegprep.std_limodesign(factors, trialinfo, *args, splitreg='off', interaction='off', desconly='off', filepath='', return_com=False, **kwargs)

Create LIMO-compatible categorical and continuous design matrices.

Parameters:
Return type:

Any

eegprep.std_getindvar(STUDY, mode='both', scandesign=False)

Return STUDY factor names, values, subject groupings, and pairing flags.

Parameters:
Return type:

tuple[list[str], list[list[Any]], list[list[list[Any]]], list[str]]

eegprep.std_indvarmatch(value, valuelist)

Return 1-based indices where an independent-variable value matches.

This mirrors the useful EEGLAB behavior for strings, scalar numeric values, numeric vectors, and cell/list-valued variables while returning Python lists of EEGLAB-facing 1-based indices.

Parameters:
Return type:

list[int]

eegprep.std_selectdataset(STUDY, ALLEEG, indvar='', indvarvals=None, verboseFlag='verbose')

Return selected 1-based dataset indices and trial indices.

Dataset-level variables are matched against STUDY.datasetinfo. If the variable is not a dataset field, trial-level values are matched against STUDY.datasetinfo[*].trialinfo and dataset indices with at least one matching trial are returned.

Parameters:
Return type:

tuple[list[int], list[list[int]]]

eegprep.std_gettrialsind(trialinfo, *args, return_values=False, **kwargs)

Return 1-based trial indices matching all requested trialinfo values.

trialinfo may be a list of trial dictionaries or a dictionary with a trialinfo field. MATLAB .mat filename loading is intentionally not part of the standalone runtime; pass loaded trialinfo rows instead.

Parameters:
Return type:

Any

eegprep.std_maketrialinfo(STUDY, ALLEEG)

Populate STUDY.datasetinfo[*].trialinfo from loaded EEG metadata.

Parameters:
Return type:

tuple[dict[str, Any], list[list[dict[str, Any]]]]

eegprep.std_combtrialinfo(datasetinfo, inds, trials=None)

Return trial rows enriched with selected datasetinfo fields.

Parameters:
Return type:

list[dict[str, Any]]

eegprep.std_rebuilddesign(STUDY, ALLEEG=None, designind=None, *, return_com=False)

Refresh STUDY design variables after dataset metadata changes.

Parameters:
Return type:

Any

eegprep.std_saveindvar(STUDY, *, return_com=False)

Save factor descriptors under STUDY.etc.eegprep.independent_variables.

Parameters:
Return type:

Any

eegprep.pop_addindepvar(varlist, fig=None, var=None, values=None, *, vartype=None, return_com=False)

Return (variable, values, categorical_flag) for STUDY designs.

EEGPrep implements the workflow-supporting non-GUI behavior of EEGLAB’s helper. Callback strings and MATLAB figure mutation are intentionally not emulated.

Parameters:
Return type:

Any

eegprep.pop_importgroupvar(STUDY, designind=1, *, variable, values=None, filepath=None, vartype='categorical', return_com=False)

Attach one imported variable value per STUDY subject.

Values may be a {subject: value} mapping, a sequence in design subject order, or a text file containing one value per subject.

Parameters:
Return type:

Any

eegprep.pop_listfactors(des, *args, return_com=False, **kwargs)

Return factor descriptors for one STUDY or design structure.

Parameters:
Return type:

list[dict[str, Any]] | tuple[list[dict[str, Any]], str]

eegprep.std_precomp(STUDY, ALLEEG, chanorcomp='channels', *args, erp='off', spec='off', ersp='off', itc='off', scalp='off', allcomps='off', recompute='off', design=None, erpparams=None, specparams=None, erspparams=None, return_com=False, **kwargs)

Precompute ERP, spectrum, ERSP, and ITC measures for a STUDY.

Measures are stored directly in STUDY.changrp for channels and in the parent STUDY.cluster entry for components. Field names follow EEGLAB’s cached-measure names while avoiding EEGLAB sidecar files at runtime.

Parameters:
Return type:

Any

eegprep.std_readdata(STUDY, ALLEEG=None, *, datatype='erp', channels=None, clusters=None, components=None, design=None, timerange=None, freqrange=None, subject=None, infotype=None, **kwargs)

Read precomputed STUDY measures from EEGPrep’s in-memory cache.

Parameters:
Return type:

tuple[dict[str, Any], list[ndarray], ndarray, ndarray]

eegprep.std_readerp(STUDY, ALLEEG=None, **kwargs)

Read cached STUDY ERP measures.

Parameters:
eegprep.std_readspec(STUDY, ALLEEG=None, **kwargs)

Read cached STUDY spectrum measures.

Parameters:
eegprep.std_readersp(STUDY, ALLEEG=None, **kwargs)

Read cached STUDY ERSP measures.

Parameters:
eegprep.std_readitc(STUDY, ALLEEG=None, **kwargs)

Read cached STUDY ITC measures.

Parameters:
eegprep.std_readtopo(STUDY, ALLEEG=None, *, clusters=None, components=None, **_kwargs)

Read cached STUDY component scalp topographies.

Parameters:
Return type:

tuple[dict[str, Any], list[ndarray], ndarray]

eegprep.std_readpac(STUDY, ALLEEG=None, *, channels=None, channels1=None, channels2=None, clusters=None, clusters1=None, clusters2=None, components=None, design=None, timerange=None, freqrange=None, condition=None, onepersubj=None, forceread=None, recompute=None, **kwargs)

Read EEGPrep-owned cached STUDY PAC data when present.

Parameters:
Return type:

tuple[dict[str, Any], list[ndarray], ndarray, ndarray]

eegprep.std_pac(EEG_or_STUDY, ALLEEG=None, *args, components1=None, components2=None, channels1=None, channels2=None, outputfile='', plot='off', recompute='off', getparams='off', timerange=None, freqrange=None, padratio=1, freqs=None, cycles=None, freqphase=None, cyclephase=None, interp=None, rmcomps=None, freqscale='log', return_com=False, **kwargs)

Compute phase-amplitude coupling for an EEG dataset or STUDY.

Single-dataset calls return (pacdata, times, freqs, parameters). STUDY calls return (STUDY, ALLEEG) and store the computed cache under STUDY.changrp[*].pacdata using EEGPrep’s in-memory measure contract.

Parameters:
Return type:

Any

eegprep.std_pacplot(STUDY, ALLEEG, *args, channels=None, channels1=None, clusters=None, components=None, design=None, noplot='off', plotmode='normal', return_com=False, **kwargs)

Read and optionally plot precomputed STUDY PAC measures.

Parameters:
Return type:

tuple[Any, …]

eegprep.std_prepare_neighbors(STUDY, ALLEEG, *args, force='off', channels=None, method='distance', neighbordist=None, return_com=False, **kwargs)

Prepare a FieldTrip-like neighbor list and LIMO adjacency matrix.

Parameters:
Return type:

Any

eegprep.std_interp(STUDY, ALLEEG, chans=None, method='spherical', *args, return_com=False, **kwargs)

Interpolate selected missing channels into every STUDY dataset.

Parameters:
Return type:

Any

eegprep.std_dipplot(*args, **kwargs)

Report the standalone boundary for STUDY-level source plotting.

Parameters:
Return type:

None

eegprep.std_dipoleclusters(*args, **kwargs)

Report the standalone boundary for STUDY dipole-cluster workflows.

Parameters:
Return type:

None

eegprep.std_savedat(tmpfile, structure)

Save a measure structure as JSON or MATLAB-compatible MAT data.

Parameters:
Return type:

Path

eegprep.std_checkfiles(STUDY, ALLEEG=None, *, return_report=False)

Check loaded STUDY data and cached measures for standalone EEGPrep.

Parameters:
Return type:

Any

eegprep.std_checkdatasession(STUDY, ALLEEG=None, *, return_report=False)

Check dataset/session alignment for a STUDY and loaded ALLEEG.

Parameters:
Return type:

Any

eegprep.std_uniformfiles(STUDY, ALLEEG)

Return 1 for uniform channels, 0 for mismatch, -1 for missing files.

Parameters:
Return type:

int

eegprep.std_uniformsetinds(STUDY)

Return 1 when STUDY channel group set indices are uniform.

Parameters:

STUDY (dict[str, Any])

Return type:

int

eegprep.std_findsameica(ALLEEG, icathreshold=0.0002)

Group 1-based dataset indices with near-identical ICA weights*sphere.

EEGPrep keeps cross-subject decompositions in separate groups because subject labels are a STUDY grouping boundary for downstream workflows.

Parameters:
Return type:

tuple[list[list[int]], list[int]]

eegprep.std_selsubject(data, subject, setinds, allsubjects, optndims=None)

Return cached-measure cells with only the requested subject columns.

Parameters:
  • data (Any)

  • subject (str)

  • setinds (Any)

  • allsubjects (Any)

  • optndims (int | None)

Return type:

Any

eegprep.std_substudy(STUDY, ALLEEG, *args, dataset=None, subject=None, condition=None, group=None, rmdat='on', return_com=False, **kwargs)

Return a STUDY/ALLEEG subset using EEGLAB-facing 1-based selectors.

Parameters:
Return type:

Any

eegprep.std_rmdat(STUDY, ALLEEG, *args, datinds=None, chanrange=(0, inf), pntsrange=(0, inf), sraterange=(0, inf), trialrange=(1, inf), checkeventtype=None, numeventrange=1, subjectind=None, rmvarvalues=None, keepvarvalues=None, return_com=False, **kwargs)

Remove datasets from STUDY/ALLEEG and return removed 1-based indices.

Parameters:
Return type:

Any

eegprep.std_rmalldatafields(STUDY, chanorcomp='both')

Return STUDY without cached measure/data fields for the requested target.

Parameters:
Return type:

dict[str, Any]

eegprep.std_erpplot(STUDY, ALLEEG, *args, **kwargs)

Read and plot precomputed STUDY ERP measures.

Parameters:
eegprep.std_specplot(STUDY, ALLEEG, *args, **kwargs)

Read and plot precomputed STUDY spectrum measures.

Parameters:
eegprep.std_erspplot(STUDY, ALLEEG, *args, **kwargs)

Read and plot precomputed STUDY ERSP measures.

Parameters:
eegprep.std_itcplot(STUDY, ALLEEG, *args, **kwargs)

Read and plot precomputed STUDY ITC measures.

Parameters:
eegprep.optimal_kmeans(clustdata, clusnum, *, random_state=0)

Run k-means for a range and choose the best silhouette score.

Parameters:
Return type:

tuple[ndarray, ndarray, ndarray, ndarray]

eegprep.robust_kmeans(data, clus_num, STD=3.0, MAXiter=10, method='kmeans', *, random_state=0)

Cluster rows and iteratively mark distant rows as outliers.

Parameters:
Return type:

tuple[ndarray, ndarray, ndarray, ndarray, ndarray]

eegprep.std_apcluster(clustdata, *, maxits=200, convits=100, dampfact=0.9, dist='euclidean')

Cluster rows using deterministic affinity propagation updates.

Parameters:
Return type:

tuple[ndarray, ndarray, ndarray]

eegprep.std_centroid(data, labels=None)

Return centroids for all rows or for each positive label.

Parameters:
  • data (Any)

  • labels (Any | None)

Return type:

ndarray

eegprep.std_findoutlierclust(data, labels=None, *, threshold=3.0)

Return 1-based row indices farther than threshold cluster spreads.

Parameters:
Return type:

ndarray

eegprep.pop_limo(*args, **kwargs)

Report that standalone EEGPrep does not run external LIMO workflows.

Parameters:
Return type:

None

eegprep.pop_limoresults(*args, **kwargs)

Report that standalone EEGPrep does not browse external LIMO results.

Parameters:
Return type:

None

eegprep.std_selectdesign(STUDY, ALLEEG, designind)

Select a 1-based STUDY design index.

Parameters:
Return type:

dict[str, Any]

Format Conversion#

eegprep.eeg_eeg2mne(EEG)

Convert EEG data structure to MNE Raw object.

Parameters#

EEGdict

EEG data structure

Returns#

rawmne.io.Raw

MNE Raw object

eegprep.eeg_mne2eeg(raw)

Convert MNE Raw object to EEG data structure.

Parameters#

rawmne.io.Raw | mne.BaseEpochs

MNE Raw or Epochs object.

Returns#

EEGdict

EEG data structure

eegprep.eeg_mne2eeg_epochs(epochs, ica)

Convert MNE epochs with ICA to EEGLAB dataset format.

Parameters#

epochsmne.Epochs

MNE epochs object.

icamne.preprocessing.ICA

MNE ICA object.

Returns#

dict

EEGLAB-compatible dataset dictionary.