eegdash.to_bids.tueg module#

The TUH EEG Corpus (TUEG) 2.0.1 (NEDC, EDF) as BIDS.

A user obtains the corpus from the Neural Engineering Data Consortium (NEDC) under NEDC’s terms, which forbid redistribution, and makes the tree from that copy. The source is the release root (AAREADME.txt, DOCS/, edf/); every EDF under edf/ is laid out as <NNN>/<subject>/s<SSS>_<YYYY>/<montage>/<subject>_s<SSS>_t<TTT>.edf and enters the tree as it is (linked or copied):

  • sub-<subject>;

  • ses-<SSS>y<YYYY>: the session number alone is not unique, as one subject has s012_2014 and s012_2016 with the same file names;

  • task-clinical;

  • acq-ar, acq-le, acq-ara, acq-lea from the montage folders 01_tcp_ar, 02_tcp_le, 03_tcp_ar_a, 04_tcp_le_a;

  • run-<TTT> from t<TTT>.

A recording’s key (what the held-out table matches) is the file stem. Channel names drop a leading EEG `` and a trailing ``-REF / -LE (tables/tueg-2.0.1.channels.csv); power line 60 Hz; EEGReference is n/a, as the release defines neither ar nor le. TUAB recordings and the recordings of TUEV training subjects are left out (tables/tueg-2.0.1.heldout.csv, SHA-256 of each key). participants.tsv holds participant_id only; there are no events.

class eegdash.to_bids.tueg.TUEG(src: Path, version: str)[source]

Bases: Adapter

The TUH EEG Corpus (TUEG) 2.0.1 (NEDC): see the module docstring.

channels(rec: Recording, header: Header) → list[Channel][source]

One channel per label of header, in its order.

check_source() → None[source]

Raise ValueError when the source is not this dataset.

dataset_description() → dict[str, Any][source]

Name, License, Authors, DOI and links of dataset_description.json.

extension: ClassVar[str] = '.edf'
linkable: ClassVar[bool] = True
name: ClassVar[str] = 'tueg'
readme(summary: dict[str, Any]) → str[source]

README.md, from the run’s summary (subjects, recordings, hours, warnings).

recordings() → Iterator[Recording][source]

Every data file of the source: a walk that opens no data file.

revision: ClassVar[int] = 2
sidecar(rec: Recording, header: Header) → dict[str, Any][source]

The adapter’s keys of _eeg.json: EEGReference, PowerLineFrequency, …

versions: ClassVar[tuple[str, ...]] = ('2.0.1',)
eegdash.to_bids.tueg.parse_path(rel: Path, montages: dict[str, str]) → dict[str, str] | str[source]

The entities of an EDF path relative to edf/, or why it is not in the layout.

000/aaaaaaaa/s012_2014/01_tcp_ar/aaaaaaaa_s012_t000.edf -> {subject: aaaaaaaa, session: 012y2014, acquisition: ar, run: 000}.

eegdash.to_bids.tueg.walk_edf(root: Path) → list[Path][source]

Every .edf file under root (any case), relative to it, sorted.