pub struct MiscData { /* private fields */ }Expand description
A 3D array container for miscellaneous floating-point data.
Used for storing arbitrary 3D data structures with width, height, and depth dimensions. Supports conversion from image frames and individual float values.
§Example
use feagi_sensorimotor::data_types::{MiscData, descriptors::MiscDataDimensions};
let dims = MiscDataDimensions::new(10, 10, 5).unwrap();
let misc_data = MiscData::new(&dims).unwrap();
assert_eq!(misc_data.get_dimensions().width, 10);Implementations§
Source§impl MiscData
impl MiscData
Sourcepub fn new(resolution: &MiscDataDimensions) -> Result<MiscData, FeagiDataError>
pub fn new(resolution: &MiscDataDimensions) -> Result<MiscData, FeagiDataError>
Creates a new MiscData container filled with zeros.
Sourcepub fn new_with_data(
data: ArrayBase<OwnedRepr<f32>, Dim<[usize; 3]>>,
) -> Result<MiscData, FeagiDataError>
pub fn new_with_data( data: ArrayBase<OwnedRepr<f32>, Dim<[usize; 3]>>, ) -> Result<MiscData, FeagiDataError>
Creates a MiscData container from an existing 3D array.
Returns an error if any dimension is zero.
Sourcepub fn new_from_image_frame(
image: &ImageFrame,
) -> Result<MiscData, FeagiDataError>
pub fn new_from_image_frame( image: &ImageFrame, ) -> Result<MiscData, FeagiDataError>
Creates MiscData from an image frame by normalizing pixel values to [0.0, 1.0].
Sourcepub fn new_from_f32(value: f32) -> Result<MiscData, FeagiDataError>
pub fn new_from_f32(value: f32) -> Result<MiscData, FeagiDataError>
Creates a 1x1x1 MiscData container with a single float value.
pub fn get_dimensions(&self) -> MiscDataDimensions
pub fn get_internal_data(&self) -> &ArrayBase<OwnedRepr<f32>, Dim<[usize; 3]>>
pub fn get_internal_data_mut( &mut self, ) -> &mut ArrayBase<OwnedRepr<f32>, Dim<[usize; 3]>>
pub fn blank_data(&mut self)
pub fn overwrite_neuron_data( &self, write_target: &mut NeuronVoxelXYZPArrays, x_channel_offset: CorticalChannelIndex, ) -> Result<(), FeagiDataError>
Trait Implementations§
Source§impl From<MiscData> for WrappedIOData
impl From<MiscData> for WrappedIOData
Source§fn from(value: MiscData) -> WrappedIOData
fn from(value: MiscData) -> WrappedIOData
Converts to this type from the input type.
Source§impl<'a> TryFrom<&'a WrappedIOData> for &'a MiscData
impl<'a> TryFrom<&'a WrappedIOData> for &'a MiscData
Source§type Error = FeagiDataError
type Error = FeagiDataError
The type returned in the event of a conversion error.
Source§fn try_from(
value: &'a WrappedIOData,
) -> Result<&'a MiscData, <&'a MiscData as TryFrom<&'a WrappedIOData>>::Error>
fn try_from( value: &'a WrappedIOData, ) -> Result<&'a MiscData, <&'a MiscData as TryFrom<&'a WrappedIOData>>::Error>
Performs the conversion.
Source§impl TryFrom<&WrappedIOData> for MiscData
impl TryFrom<&WrappedIOData> for MiscData
Source§type Error = FeagiDataError
type Error = FeagiDataError
The type returned in the event of a conversion error.
Source§fn try_from(
value: &WrappedIOData,
) -> Result<MiscData, <MiscData as TryFrom<&WrappedIOData>>::Error>
fn try_from( value: &WrappedIOData, ) -> Result<MiscData, <MiscData as TryFrom<&WrappedIOData>>::Error>
Performs the conversion.
Source§impl<'a> TryFrom<&'a mut WrappedIOData> for &'a mut MiscData
impl<'a> TryFrom<&'a mut WrappedIOData> for &'a mut MiscData
Source§type Error = FeagiDataError
type Error = FeagiDataError
The type returned in the event of a conversion error.
Source§fn try_from(
value: &'a mut WrappedIOData,
) -> Result<&'a mut MiscData, <&'a mut MiscData as TryFrom<&'a mut WrappedIOData>>::Error>
fn try_from( value: &'a mut WrappedIOData, ) -> Result<&'a mut MiscData, <&'a mut MiscData as TryFrom<&'a mut WrappedIOData>>::Error>
Performs the conversion.
Source§impl TryFrom<WrappedIOData> for MiscData
impl TryFrom<WrappedIOData> for MiscData
Source§type Error = FeagiDataError
type Error = FeagiDataError
The type returned in the event of a conversion error.
Source§fn try_from(
value: WrappedIOData,
) -> Result<MiscData, <MiscData as TryFrom<WrappedIOData>>::Error>
fn try_from( value: WrappedIOData, ) -> Result<MiscData, <MiscData as TryFrom<WrappedIOData>>::Error>
Performs the conversion.
impl StructuralPartialEq for MiscData
Auto Trait Implementations§
impl Freeze for MiscData
impl RefUnwindSafe for MiscData
impl Send for MiscData
impl Sync for MiscData
impl Unpin for MiscData
impl UnwindSafe for MiscData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.