Expand description
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 aBidsLayout.Channel/ChannelType— Typed representation of_channels.tsventries with support for all BIDS channel types (EEG, EOG, ECG, EMG, TRIG, MISC, MEGMAG, MEGGRAD, ECOG, SEEG, DBS, etc.).Electrode— Electrode positions from_electrodes.tsvwith optional 3D coordinates, material, and impedance.EegEvent— Events from_events.tsvwith 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. Useread_eeg_datafor automatic format detection, orread_edf/read_brainvisiondirectly.Annotation— Time-stamped annotation parsed from EDF+ TAL channels, BDF status channels, or BrainVision.vmrkmarker files.
§Example
use bids_eeg::EegLayout;
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());
}
}Re-exports§
pub use channels::Channel;pub use channels::ChannelType;pub use channels::read_channels_tsv;pub use coordsystem::CoordinateSystem;pub use csp::CSP;pub use data::Annotation;pub use data::EegData;pub use data::ReadOptions;pub use data::read_brainvision;pub use data::read_brainvision_markers;pub use data::read_edf;pub use data::read_eeg_data;pub use eeg_layout::EdfHeader;pub use eeg_layout::EegDatasetSummary;pub use eeg_layout::EegLayout;pub use eeg_layout::PhysioData;pub use electrodes::Electrode;pub use electrodes::read_electrodes_tsv;pub use events::EegEvent;pub use events::read_events_tsv;pub use harmonize::ChannelStrategy;pub use harmonize::HarmonizationPlan;pub use harmonize::apply_harmonization;pub use harmonize::plan_harmonization;pub use metadata::EegMetadata;pub use pipeline::Pipeline as EegPipeline;pub use pipeline::PipelineResult;
Modules§
- channels
- EEG channel definitions and
_channels.tsvparsing. - coordsystem
- Coordinate system information from
_coordsystem.json. - csp
- Common Spatial Patterns (CSP) for motor imagery BCI.
- data
- EEG signal data reading: EDF, BDF, and BrainVision formats.
- eeg_
layout - High-level EEG interface on top of
BidsLayout. - electrodes
- Electrode positions from
_electrodes.tsv. - events
- EEG events from
_events.tsv. - harmonize
- Channel harmonization across datasets.
- metadata
- Typed EEG metadata from JSON sidecars.
- pipeline
- Composable preprocessing pipeline for EEG data.