pub struct NdArrayMessage {
pub scalar_type: ScalarType,
pub size: Vec<u16>,
pub data: Vec<u8>,
}
Expand description
NDARRAY message containing an N-dimensional numerical array
§OpenIGTLink Specification
- Message type: “NDARRAY”
- Body format: SCALAR_TYPE (uint8) + DIM (uint8) + SIZE (
uint16[DIM]
) + DATA (bytes) - Data layout: Row-major order (C-style)
Fields§
§scalar_type: ScalarType
Scalar data type
size: Vec<u16>
Array dimensions
data: Vec<u8>
Raw array data in network byte order
Implementations§
Source§impl NdArrayMessage
impl NdArrayMessage
Sourcepub fn new(
scalar_type: ScalarType,
size: Vec<u16>,
data: Vec<u8>,
) -> Result<Self>
pub fn new( scalar_type: ScalarType, size: Vec<u16>, data: Vec<u8>, ) -> Result<Self>
Create a new NDARRAY message
Sourcepub fn new_2d(
scalar_type: ScalarType,
rows: u16,
cols: u16,
data: Vec<u8>,
) -> Result<Self>
pub fn new_2d( scalar_type: ScalarType, rows: u16, cols: u16, data: Vec<u8>, ) -> Result<Self>
Create a 2D array
Sourcepub fn new_3d(
scalar_type: ScalarType,
dim1: u16,
dim2: u16,
dim3: u16,
data: Vec<u8>,
) -> Result<Self>
pub fn new_3d( scalar_type: ScalarType, dim1: u16, dim2: u16, dim3: u16, data: Vec<u8>, ) -> Result<Self>
Create a 3D array
Sourcepub fn element_count(&self) -> usize
pub fn element_count(&self) -> usize
Get total number of elements
Trait Implementations§
Source§impl Clone for NdArrayMessage
impl Clone for NdArrayMessage
Source§fn clone(&self) -> NdArrayMessage
fn clone(&self) -> NdArrayMessage
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 moreSource§impl Debug for NdArrayMessage
impl Debug for NdArrayMessage
Source§impl Message for NdArrayMessage
impl Message for NdArrayMessage
Source§impl PartialEq for NdArrayMessage
impl PartialEq for NdArrayMessage
impl StructuralPartialEq for NdArrayMessage
Auto Trait Implementations§
impl Freeze for NdArrayMessage
impl RefUnwindSafe for NdArrayMessage
impl Send for NdArrayMessage
impl Sync for NdArrayMessage
impl Unpin for NdArrayMessage
impl UnwindSafe for NdArrayMessage
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