Data Loading and Saving#

Readers and writers for EEG datasets, channel locations, and MNE interchange. getchanlist returns 1-based channel numbers.

eegprep.biosig2eeglabevent(EVENT[, ...])

Convert a BioSig EVENT mapping into EEG event records.

eegprep.cart2topo(x, *args)

Convert XYZ Cartesian coordinates to polar topoplot coordinates.

eegprep.chancenter(x, y, z[, center])

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

eegprep.convertlocs(chans[, command, verbose])

Return channel locations with requested coordinate fields filled in.

eegprep.coregister(chanlocs1[, chanlocs2, ...])

Coregister one electrode montage to another without opening a GUI.

eegprep.decodechan(*args, **kwargs)

Wrap eeg_decodechan.

eegprep.eeg2mne(*args, **kwargs)

Wrap eeg_eeg2mne.

eegprep.eeg_chaninds(EEG, channel_names[, ...])

Return 0-based indices for channel labels.

eegprep.eeg_decodechan(chanlocs, chanstr[, ...])

Resolve channel identifiers to 0-based indices and labels.

eegprep.eeg_eeg2mne(EEG)

Convert an EEG dataset to an MNE Raw or Epochs object.

eegprep.eeg_mne2eeg(raw)

Convert an MNE Raw or Epochs object to an EEG dataset.

eegprep.eeg_mne2eeg_epochs(epochs, ica)

Convert MNE epochs with ICA to an EEG dataset.

eegprep.eeg_matchchans(big_locations, ...[, ...])

Return a unique nearest large-montage channel for each small channel.

eegprep.eeg_mergechan(locations1, locations2)

Merge channel locations by label while preserving montage order.

eegprep.eeg_mergelocs(*location_sets)

Merge ordered montages and report incompatible electrode ordering.

eegprep.floatread(filename, size[, format, ...])

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

eegprep.floatwrite(data, filename[, format, ...])

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

eegprep.loadcnt(filename, *args[, t1, ...])

Load a Neuroscan CNT file into a low-level CNT dictionary.

eegprep.loadeeg(filename[, chanlist, ...])

Load a Neuroscan epoch file and its per-sweep metadata.

eegprep.loadtxt(filename, *args[, convert, ...])

Read an EEGLAB-style numeric or mixed-value text table.

eegprep.loadset(file_path)

Load EEGLAB dataset from file (alias for pop_loadset).

eegprep.MemmapData(filename, shape, *[, ...])

NumPy-compatible handle for channel-major EEG data stored on disk.

eegprep.mmo(data_file, dimensions[, ...])

Construct an EEGLAB-compatible memory-mapped EEG data handle.

eegprep.getchanlist(chanlocs[, channel_type])

Return 1-based channel indices matching one or more types.

eegprep.mne2eeg(*args, **kwargs)

Wrap eeg_mne2eeg.

eegprep.mne2eeg_epochs(*args, **kwargs)

Wrap eeg_mne2eeg_epochs.

eegprep.openbdf(filename, *[, return_header])

Read a BDF header and prepare an EEGLAB-compatible record dataset.

eegprep.parsetxt(txt[, delims])

Split text at any delimiter character and discard empty tokens.

eegprep.pop_loadbv(-> dict[str, ~typing.Any])

Load a BrainVision .vhdr recording.

eegprep.pop_loadcnt(filename, *args[, ...])

Load a Neuroscan CNT recording into an EEG dictionary.

eegprep.readbdf(dataset, records[, mode])

Read selected 1-based BDF records.

eegprep.read_erpss(filename)

Read an ERPSS recording into channel-major microvolt data.

eegprep.readegi(filename[, data_chunks, ...])

Read an EGI Simple Binary file (versions 2 through 7).

eegprep.readegihdr(filename[, forceversion])

Read an EGI Simple Binary header.

eegprep.readeetraklocs(filename)

Read a simple EETrak/ASA .elc location file.

eegprep.readegilocs(EEG[, fileloc])

Return EEG with EGI channel locations from packaged montages.

eegprep.readelp(filename)

Read a Polhemus .elp electrode-position file.

eegprep.readlocs(filename, *args[, ...])

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

eegprep.readneurodat(filename)

Read a Neuroscan .dat electrode file.

eegprep.readtxtfile(filename)

Return file contents with one leading newline and normalized lines.

eegprep.saveset(*args, **kwargs)

Wrap pop_saveset.

eegprep.snapread(filename[, seekframes, ...])

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

eegprep.shortread(filename, size[, format, ...])

Read an int16 matrix using MATLAB column ordering.

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

Write channel locations to an EEGLAB-compatible text file.

eegprep.writegdf(filename, data, ...[, ...])

Write finite continuous channel-major data as GDF 1.25.

readegilocs includes packaged EGI montages for 32/33, 64/65, 128/129, and 256/257-channel nets.

loadcnt and pop_loadcnt read Neuroscan CNT data without an EEGLAB checkout. They support 16- and 32-bit recordings, channel-blocked storage, microvolt calibration, partial reads, event tables, and .fdt-backed data. ANT Neuro CNT is a separate format and is not accepted by this reader.

BrainVision recordings#

Load a BrainVision Data Exchange recording through its header. The companion data and marker files are resolved from the header and must remain beside it.

from eegprep import pop_loadbv

EEG = pop_loadbv("subject01.vhdr")
EEG = pop_loadbv("/data/session", "subject01.vhdr", [1001, 5000], [1, 2, 8])

srange and chans use EEGLAB-compatible 1-based indexing; a two-value sample range is inclusive. Binary and ASCII, multiplexed and vectorized data are supported. Voltage data is normalized to microvolts while the original unit and resolution remain in each channel’s bvunit and bvresolution fields. Use metadata=True to inspect dimensions, channels, and events without loading samples. Uniform marker-based or fixed-time segments are returned as trials rather than a flattened continuous array. BIDS import uses this same reader for .vhdr files.

read_erpss reads uncompressed and delta-compressed ERPSS .RAW and .RDF recordings without a compiled MEX extension. It preserves channel labels and 1-based event sample offsets, and supports both little- and big-endian files.

readegi reads EGI Simple Binary RAW versions 2 through 7 without an EEGLAB installation. Frame and segment selections are 1-based, while returned sample arrays are channel-major. readegihdr reads the same acquisition and event-code metadata without loading signal samples.