pub struct EegLayout<'a> { /* private fields */ }Expand description
High-level EEG-specific interface built on top of BidsLayout.
Implementations§
Source§impl<'a> EegLayout<'a>
impl<'a> EegLayout<'a>
pub fn new(layout: &'a BidsLayout) -> Self
pub fn get_eeg_files(&self) -> Result<Vec<BidsFile>>
pub fn get_eeg_files_for_subject(&self, subject: &str) -> Result<Vec<BidsFile>>
pub fn get_eeg_files_for_task(&self, task: &str) -> Result<Vec<BidsFile>>
pub fn get_channels(&self, f: &BidsFile) -> Result<Option<Vec<Channel>>>
pub fn get_electrodes(&self, f: &BidsFile) -> Result<Option<Vec<Electrode>>>
pub fn get_events(&self, f: &BidsFile) -> Result<Option<Vec<EegEvent>>>
pub fn get_eeg_metadata(&self, f: &BidsFile) -> Result<Option<EegMetadata>>
pub fn get_coordsystem(&self, f: &BidsFile) -> Result<Option<CoordinateSystem>>
pub fn get_physio(&self, f: &BidsFile) -> Result<Option<PhysioData>>
pub fn read_edf_header(&self, f: &BidsFile) -> Result<Option<EdfHeader>>
Sourcepub fn read_data(&self, f: &BidsFile, opts: &ReadOptions) -> Result<EegData>
pub fn read_data(&self, f: &BidsFile, opts: &ReadOptions) -> Result<EegData>
Read the actual signal data from an EEG data file.
Automatically detects the format from the file extension (.edf, .bdf, .vhdr) and returns the multichannel time-series data in physical units.
For BrainVision files, the companion binary file (.eeg/.dat) is resolved relative to the .vhdr header file.
§Example
use bids_eeg::{EegLayout, ReadOptions};
let eeg = EegLayout::new(&layout);
let files = eeg.get_eeg_files().unwrap();
if let Some(f) = files.first() {
let data = eeg.read_data(f, &ReadOptions::default()).unwrap();
println!("{} channels, {} samples", data.n_channels(), data.n_samples(0));
}Sourcepub fn read_data_channels(
&self,
f: &BidsFile,
channels: &[&str],
) -> Result<EegData>
pub fn read_data_channels( &self, f: &BidsFile, channels: &[&str], ) -> Result<EegData>
Read the signal data from an EEG file, selecting specific channels.
Convenience wrapper around read_data that pre-fills
the channel filter in ReadOptions.
Sourcepub fn read_data_time_range(
&self,
f: &BidsFile,
start: f64,
end: f64,
) -> Result<EegData>
pub fn read_data_time_range( &self, f: &BidsFile, start: f64, end: f64, ) -> Result<EegData>
Read a time window from an EEG data file.
Convenience wrapper around read_data that pre-fills
the time range in ReadOptions.
Sourcepub fn get_brainvision_markers(
&self,
f: &BidsFile,
sampling_rate: f64,
) -> Result<Vec<Annotation>>
pub fn get_brainvision_markers( &self, f: &BidsFile, sampling_rate: f64, ) -> Result<Vec<Annotation>>
Read annotations/markers from a BrainVision .vmrk file associated with the given EEG file.
pub fn get_all_channels_files(&self) -> Result<Vec<BidsFile>>
pub fn get_all_electrodes_files(&self) -> Result<Vec<BidsFile>>
pub fn get_all_events_files(&self) -> Result<Vec<BidsFile>>
pub fn get_eeg_subjects(&self) -> Result<Vec<String>>
pub fn get_eeg_tasks(&self) -> Result<Vec<String>>
pub fn summary(&self) -> Result<EegDatasetSummary>
Auto Trait Implementations§
impl<'a> Freeze for EegLayout<'a>
impl<'a> !RefUnwindSafe for EegLayout<'a>
impl<'a> !Send for EegLayout<'a>
impl<'a> !Sync for EegLayout<'a>
impl<'a> Unpin for EegLayout<'a>
impl<'a> UnsafeUnpin for EegLayout<'a>
impl<'a> !UnwindSafe for EegLayout<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more