[][src]Struct nifti::volume::inmem::InMemNiftiVolume

pub struct InMemNiftiVolume { /* fields omitted */ }

A data type for a NIFTI-1 volume contained in memory. Objects of this type contain raw image data, which is converted automatically when using reading methods or converting it to an ndarray (only with the ndarray_volumes feature).

Since NIfTI volumes are stored in disk in column major order (also called Fortran order), this data type will also retain this memory order.

Implementations

impl InMemNiftiVolume[src]

pub fn from_raw_data(header: &NiftiHeader, raw_data: Vec<u8>) -> Result<Self>[src]

Build an InMemNiftiVolume from a header and a buffer. The buffer length and the dimensions declared in the header are expected to fit.

pub fn from_raw_fields(
    raw_dim: [u16; 8],
    datatype: NiftiType,
    scl_slope: f32,
    scl_inter: f32,
    raw_data: Vec<u8>,
    endianness: Endianness
) -> Result<Self>
[src]

Build an InMemNiftiVolume from its raw set of attributes. The raw data is assumed to contain exactly enough bytes to contain the data elements of the volume in F-major order, with the byte order specified in endianness, as specified by the volume shape in raw_dim and data type in datatype.

pub fn from_reader<R: Read>(source: R, header: &NiftiHeader) -> Result<Self>[src]

Read a NIFTI volume from a stream of data. The header and expected byte order of the volume's data must be known in advance. It it also expected that the following bytes represent the first voxels of the volume (and not part of the extensions).

pub fn from_file<P: AsRef<Path>>(path: P, header: &NiftiHeader) -> Result<Self>[src]

Read a NIFTI volume from an image file. NIFTI-1 volume files usually have the extension ".img" or ".img.gz". In the latter case, the file is automatically decoded as a Gzip stream.

pub fn into_raw_data(self) -> Vec<u8>[src]

Retrieve the raw data, consuming the volume.

pub fn raw_data(&self) -> &[u8][src]

Retrieve a reference to the raw data.

pub fn raw_data_mut(&mut self) -> &mut [u8][src]

Retrieve a mutable reference to the raw data.

Trait Implementations

impl Clone for InMemNiftiVolume[src]

impl Debug for InMemNiftiVolume[src]

impl<R> FromSource<R> for InMemNiftiVolume where
    R: Read
[src]

impl FromSourceOptions for InMemNiftiVolume[src]

type Options = ()

Set of additional options required (or useful) for constructing a volume.

impl IntoNdArray for InMemNiftiVolume[src]

pub fn into_ndarray<T>(self) -> Result<Array<T, IxDyn>> where
    T: DataElement
[src]

Consume the volume into an ndarray.

impl<'a> IntoNdArray for &'a InMemNiftiVolume[src]

pub fn into_ndarray<T>(self) -> Result<Array<T, IxDyn>> where
    T: DataElement
[src]

Create an ndarray from the given volume.

impl<'a> NiftiVolume for &'a InMemNiftiVolume[src]

impl NiftiVolume for InMemNiftiVolume[src]

impl PartialEq<InMemNiftiVolume> for InMemNiftiVolume[src]

impl RandomAccessNiftiVolume for InMemNiftiVolume[src]

impl<'a> RandomAccessNiftiVolume for &'a InMemNiftiVolume[src]

impl StructuralPartialEq for InMemNiftiVolume[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,