pub struct SparseRunVariable {
pub name: String,
pub source: String,
pub onset: Vec<f64>,
pub duration: Vec<f64>,
pub amplitude: Vec<f64>,
pub str_amplitude: Vec<String>,
pub index: Vec<StringEntities>,
pub entities: StringEntities,
pub run_info: Vec<RunInfo>,
}Expand description
A sparse run variable representing events with onset, duration, and amplitude.
Loaded from _events.tsv files, each event has a time point (onset),
a duration, and an amplitude value. Multiple runs can be represented in
a single variable via the run_info vector.
Can be converted to a DenseRunVariable via to_dense()
for convolution with hemodynamic response functions or other time-domain
operations.
Corresponds to PyBIDS’ SparseRunVariable class.
Fields§
§name: String§source: String§onset: Vec<f64>§duration: Vec<f64>§amplitude: Vec<f64>§str_amplitude: Vec<String>§index: Vec<StringEntities>§entities: StringEntities§run_info: Vec<RunInfo>Implementations§
Source§impl SparseRunVariable
impl SparseRunVariable
pub fn new( name: &str, source: &str, onset: Vec<f64>, duration: Vec<f64>, amplitude: Vec<String>, index: Vec<StringEntities>, run_info: Vec<RunInfo>, ) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn get_duration(&self) -> f64
pub fn get_duration(&self) -> f64
Total duration of all runs.
Sourcepub fn to_dense(&self, sampling_rate: Option<f64>) -> DenseRunVariable
pub fn to_dense(&self, sampling_rate: Option<f64>) -> DenseRunVariable
Convert sparse to dense representation using GCD-based bin size.
Sourcepub fn filter(&self, filters: &StringEntities) -> Self
pub fn filter(&self, filters: &StringEntities) -> Self
Filter events by entity criteria.
Sourcepub fn to_rows(&self) -> Vec<StringEntities> ⓘ
pub fn to_rows(&self) -> Vec<StringEntities> ⓘ
Convert to tabular rows.
Trait Implementations§
Source§impl Clone for SparseRunVariable
impl Clone for SparseRunVariable
Source§fn clone(&self) -> SparseRunVariable
fn clone(&self) -> SparseRunVariable
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SparseRunVariable
impl RefUnwindSafe for SparseRunVariable
impl Send for SparseRunVariable
impl Sync for SparseRunVariable
impl Unpin for SparseRunVariable
impl UnsafeUnpin for SparseRunVariable
impl UnwindSafe for SparseRunVariable
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