openbdf#

openbdf(filename, *, return_header=False)#

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

Unlike the historical MATLAB helper, this function does not leave an open file descriptor in the returned structure. readbdf reopens the stored path for each read, so the result is safe to keep and serialize.

Parameters:
  • filename (str | Path) – BioSemi Data Format file.

  • return_header (bool) – Also return the raw 256-byte fixed header as a Latin-1 string.

Returns:

A dictionary containing Head and MX. If return_header is true, returns (dataset, raw_header).

Return type:

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