Skip to main content

EegLayout

Struct EegLayout 

Source
pub struct EegLayout<'a> { /* private fields */ }
Expand description

High-level EEG-specific interface built on top of BidsLayout.

Implementations§

Source§

impl<'a> EegLayout<'a>

Source

pub fn new(layout: &'a BidsLayout) -> Self

Source

pub fn get_eeg_files(&self) -> Result<Vec<BidsFile>>

Source

pub fn get_eeg_files_for_subject(&self, subject: &str) -> Result<Vec<BidsFile>>

Source

pub fn get_eeg_files_for_task(&self, task: &str) -> Result<Vec<BidsFile>>

Source

pub fn get_channels(&self, f: &BidsFile) -> Result<Option<Vec<Channel>>>

Source

pub fn get_electrodes(&self, f: &BidsFile) -> Result<Option<Vec<Electrode>>>

Source

pub fn get_events(&self, f: &BidsFile) -> Result<Option<Vec<EegEvent>>>

Source

pub fn get_eeg_metadata(&self, f: &BidsFile) -> Result<Option<EegMetadata>>

Source

pub fn get_coordsystem(&self, f: &BidsFile) -> Result<Option<CoordinateSystem>>

Source

pub fn get_physio(&self, f: &BidsFile) -> Result<Option<PhysioData>>

Source

pub fn read_edf_header(&self, f: &BidsFile) -> Result<Option<EdfHeader>>

Source

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));
}
Source

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.

Source

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.

Source

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.

Source

pub fn get_all_channels_files(&self) -> Result<Vec<BidsFile>>

Source

pub fn get_all_electrodes_files(&self) -> Result<Vec<BidsFile>>

Source

pub fn get_all_events_files(&self) -> Result<Vec<BidsFile>>

Source

pub fn get_eeg_subjects(&self) -> Result<Vec<String>>

Source

pub fn get_eeg_tasks(&self) -> Result<Vec<String>>

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.