pub struct WaveformTemplate {
pub channel_ids: Vec<usize>,
pub num_channels: usize,
pub num_samples: usize,
pub count: usize,
pub trough_index: usize,
pub mean: Vec<f32>,
pub std: Vec<f32>,
pub se: Vec<f32>,
}Expand description
Mean action potential template, standard deviation (std), and standard error of the mean (se)
across a cluster of waveforms.
Row r of mean / std / se (each num_samples long) belongs to recording channel
channel_ids[r].
Fields§
§channel_ids: Vec<usize>Recording channel of each row.
num_channels: usize§num_samples: usize§count: usizeNumber of waveforms accumulated into this template (>= 1).
trough_index: usizeSample of the deepest trough (minimum of mean over all rows).
mean: Vec<f32>§std: Vec<f32>§se: Vec<f32>Standard Error of the Mean (SE = SD / sqrt(count)).
Implementations§
Source§impl WaveformTemplate
impl WaveformTemplate
Sourcepub fn new(
channel_ids: Vec<usize>,
num_samples: usize,
mean: Vec<f32>,
std: Vec<f32>,
) -> Self
pub fn new( channel_ids: Vec<usize>, num_samples: usize, mean: Vec<f32>, std: Vec<f32>, ) -> Self
Builds a template; mean and std are [channel_ids.len(), num_samples].
Sourcepub fn with_count(
channel_ids: Vec<usize>,
num_samples: usize,
count: usize,
mean: Vec<f32>,
std: Vec<f32>,
) -> Self
pub fn with_count( channel_ids: Vec<usize>, num_samples: usize, count: usize, mean: Vec<f32>, std: Vec<f32>, ) -> Self
Builds a template with explicit waveform count, automatically computing se = std / sqrt(count).
Sourcepub fn channel_row(&self, channel: usize) -> Option<&[f32]>
pub fn channel_row(&self, channel: usize) -> Option<&[f32]>
Mean waveform on recording channel channel, if the template covers it.
Sourcepub fn best_channel(&self) -> Option<usize>
pub fn best_channel(&self) -> Option<usize>
Recording channel with the largest peak-to-peak swing in mean.
Trait Implementations§
Source§impl Clone for WaveformTemplate
impl Clone for WaveformTemplate
Source§impl Debug for WaveformTemplate
impl Debug for WaveformTemplate
Source§impl<'de> Deserialize<'de> for WaveformTemplate
impl<'de> Deserialize<'de> for WaveformTemplate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for WaveformTemplate
impl PartialEq for WaveformTemplate
Source§impl Serialize for WaveformTemplate
impl Serialize for WaveformTemplate
impl StructuralPartialEq for WaveformTemplate
Auto Trait Implementations§
impl Forget for WaveformTemplate
impl Freeze for WaveformTemplate
impl Move for WaveformTemplate
impl RefUnwindSafe for WaveformTemplate
impl Send for WaveformTemplate
impl Sync for WaveformTemplate
impl Unpin for WaveformTemplate
impl UnsafeUnpin for WaveformTemplate
impl UnwindSafe for WaveformTemplate
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneExpand for Twhere
T: Clone,
impl<T> CloneExpand for Twhere
T: Clone,
fn __expand_clone_method(&self, _: &Scope) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more