[][src]Trait nifti::volume::element::DataElement

pub trait DataElement: 'static + Sized + Copy + AsPrimitive<u8> + AsPrimitive<f32> + AsPrimitive<f64> {
    type Transform: LinearTransform<Self>;

    pub const DATA_TYPE: NiftiType;

    pub fn from_raw<R: Read, E>(src: R, endianness: E) -> Result<Self>
    where
        R: Read,
        E: Endian
;
pub fn from_u8(value: u8) -> Self;
pub fn from_i8(value: i8) -> Self;
pub fn from_u16(value: u16) -> Self;
pub fn from_i16(value: i16) -> Self;
pub fn from_u32(value: u32) -> Self;
pub fn from_i32(value: i32) -> Self;
pub fn from_u64(value: u64) -> Self;
pub fn from_i64(value: i64) -> Self;
pub fn from_f32(value: f32) -> Self;
pub fn from_f64(value: f64) -> Self; pub fn from_raw_vec<E>(vec: Vec<u8>, endianness: E) -> Result<Vec<Self>>
    where
        E: Endian,
        E: Clone
, { ... } }

Trait type for characterizing a NIfTI data element, implemented for primitive numeric types which are used by the crate to represent voxel values.

Associated Types

type Transform: LinearTransform<Self>[src]

For defining how this element is linearly transformed to another.

Loading content...

Associated Constants

pub const DATA_TYPE: NiftiType[src]

The datatype mapped to the type T

Loading content...

Required methods

pub fn from_raw<R: Read, E>(src: R, endianness: E) -> Result<Self> where
    R: Read,
    E: Endian
[src]

Read a single element from the given byte source.

pub fn from_u8(value: u8) -> Self[src]

Create a single element by converting a scalar value.

pub fn from_i8(value: i8) -> Self[src]

Create a single element by converting a scalar value.

pub fn from_u16(value: u16) -> Self[src]

Create a single element by converting a scalar value.

pub fn from_i16(value: i16) -> Self[src]

Create a single element by converting a scalar value.

pub fn from_u32(value: u32) -> Self[src]

Create a single element by converting a scalar value.

pub fn from_i32(value: i32) -> Self[src]

Create a single element by converting a scalar value.

pub fn from_u64(value: u64) -> Self[src]

Create a single element by converting a scalar value.

pub fn from_i64(value: i64) -> Self[src]

Create a single element by converting a scalar value.

pub fn from_f32(value: f32) -> Self[src]

Create a single element by converting a scalar value.

pub fn from_f64(value: f64) -> Self[src]

Create a single element by converting a scalar value.

Loading content...

Provided methods

pub fn from_raw_vec<E>(vec: Vec<u8>, endianness: E) -> Result<Vec<Self>> where
    E: Endian,
    E: Clone
[src]

Transform the given data vector into a vector of data elements.

Loading content...

Implementations on Foreign Types

impl DataElement for u8[src]

type Transform = LinearTransformViaF32

impl DataElement for i8[src]

type Transform = LinearTransformViaF32

impl DataElement for u16[src]

type Transform = LinearTransformViaF32

impl DataElement for i16[src]

type Transform = LinearTransformViaF32

impl DataElement for u32[src]

type Transform = LinearTransformViaF32

impl DataElement for i32[src]

type Transform = LinearTransformViaF32

impl DataElement for u64[src]

type Transform = LinearTransformViaF64

impl DataElement for i64[src]

type Transform = LinearTransformViaF64

impl DataElement for f32[src]

type Transform = LinearTransformViaOriginal

impl DataElement for f64[src]

type Transform = LinearTransformViaOriginal

Loading content...

Implementors

Loading content...