bids-eeg 0.0.1

EEG domain support for BIDS: channels, electrodes, metadata, coordinate systems
Documentation

EEG (Electroencephalography) support for BIDS datasets.

This crate provides typed access to all EEG-specific BIDS files and metadata, corresponding to the BIDS-EEG specification.

Components

  • [EegLayout] — High-level interface for querying EEG files, channels, electrodes, events, metadata, coordinate systems, and physio data from a BidsLayout.
  • [Channel] / [ChannelType] — Typed representation of _channels.tsv entries with support for all BIDS channel types (EEG, EOG, ECG, EMG, TRIG, MISC, MEGMAG, MEGGRAD, ECOG, SEEG, DBS, etc.).
  • [Electrode] — Electrode positions from _electrodes.tsv with optional 3D coordinates, material, and impedance.
  • [EegEvent] — Events from _events.tsv with onset, duration, trial type, value, sample number, and response time.
  • [EegMetadata] — Typed EEG JSON sidecar metadata including sampling frequency, channel counts, placement scheme, reference, power line frequency, recording duration, and hardware/software filter descriptions.
  • [CoordinateSystem] — Coordinate system information from _coordsystem.json.
  • [EdfHeader] — Minimal EDF/BDF header parser for extracting channel count, sampling rates, channel labels, and recording duration directly from EEG data files.
  • [EegData] / [ReadOptions] — Read actual signal data from EDF, BDF, and BrainVision files, with support for channel inclusion/exclusion, time-range slicing, stim channel detection, and unit conversion. Use [read_eeg_data] for automatic format detection, or [read_edf] / [read_brainvision] directly.
  • [Annotation] — Time-stamped annotation parsed from EDF+ TAL channels, BDF status channels, or BrainVision .vmrk marker files.

Example

# use bids_layout::BidsLayout;
use bids_eeg::EegLayout;

# let layout = BidsLayout::new("/path").unwrap();
let eeg = EegLayout::new(&layout);
let summary = eeg.summary().unwrap();
println!("{}", summary);

for f in &eeg.get_eeg_files().unwrap() {
    if let Some(channels) = eeg.get_channels(f).unwrap() {
        println!("{}: {} channels", f.filename, channels.len());
    }
}