Struct nifti::volume::inmem::InMemNiftiVolume
[−]
[src]
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
(with the
ndarray_volumes
feature).
Methods
impl InMemNiftiVolume
[src]
fn from_stream<R: Read>(
source: R,
header: &NiftiHeader,
endianness: Endianness
) -> Result<Self>
[src]
source: R,
header: &NiftiHeader,
endianness: Endianness
) -> Result<Self>
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).
fn from_stream_with_extensions<R>(
source: R,
header: &NiftiHeader,
extender: Extender,
endianness: Endianness
) -> Result<(Self, ExtensionSequence)> where
R: Read,
[src]
source: R,
header: &NiftiHeader,
extender: Extender,
endianness: Endianness
) -> Result<(Self, ExtensionSequence)> where
R: Read,
Read a NIFTI volume, and extensions, from a stream of data. The header, extender code and expected byte order of the volume's data must be known in advance.
fn from_file<P: AsRef<Path>>(
path: P,
header: &NiftiHeader,
endianness: Endianness
) -> Result<Self>
[src]
path: P,
header: &NiftiHeader,
endianness: Endianness
) -> Result<Self>
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.
fn from_file_with_extensions<P>(
path: P,
header: &NiftiHeader,
endianness: Endianness,
extender: Extender
) -> Result<(Self, ExtensionSequence)> where
P: AsRef<Path>,
[src]
path: P,
header: &NiftiHeader,
endianness: Endianness,
extender: Extender
) -> Result<(Self, ExtensionSequence)> where
P: AsRef<Path>,
Read a NIFTI volume, along with the extensions, 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.
fn to_raw_data(self) -> Vec<u8>
[src]
Retrieve the raw data, consuming the volume.
fn get_raw_data(&self) -> &[u8]
[src]
Retrieve a reference to the raw data.
fn get_raw_data_mut(&mut self) -> &mut [u8]
[src]
Retrieve a mutable reference to the raw data.
Trait Implementations
impl Debug for InMemNiftiVolume
[src]
impl PartialEq for InMemNiftiVolume
[src]
fn eq(&self, __arg_0: &InMemNiftiVolume) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &InMemNiftiVolume) -> bool
[src]
This method tests for !=
.
impl Clone for InMemNiftiVolume
[src]
fn clone(&self) -> InMemNiftiVolume
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> NiftiVolume for &'a InMemNiftiVolume
[src]
fn dim(&self) -> &[u16]
[src]
Get the dimensions of the volume. Unlike how NIFTI-1 stores dimensions, the returned slice does not include dim[0]
and is clipped to the effective number of dimensions. Read more
fn dimensionality(&self) -> usize
[src]
Get the volume's number of dimensions. In a fully compliant file, this is equivalent to the corresponding header's dim[0]
field (with byte swapping already applied). Read more
fn data_type(&self) -> NiftiType
[src]
Get this volume's data type.
fn get_f32(&self, coords: &[u16]) -> Result<f32>
[src]
Fetch a single voxel's value in the given voxel index coordinates as a single precision floating point value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_f64(&self, coords: &[u16]) -> Result<f64>
[src]
Fetch a single voxel's value in the given voxel index coordinates as a double precision floating point value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_u8(&self, coords: &[u16]) -> Result<u8>
[src]
Fetch a single voxel's value in the given voxel index coordinates as an unsigned 8-bit value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_i8(&self, coords: &[u16]) -> Result<i8>
[src]
Fetch a single voxel's value in the given voxel index coordinates as a signed 8-bit value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_u16(&self, coords: &[u16]) -> Result<u16>
[src]
Fetch a single voxel's value in the given voxel index coordinates as an unsigned 16-bit value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_i16(&self, coords: &[u16]) -> Result<i16>
[src]
Fetch a single voxel's value in the given voxel index coordinates as a signed 16-bit value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_u32(&self, coords: &[u16]) -> Result<u32>
[src]
Fetch a single voxel's value in the given voxel index coordinates as an unsigned 32-bit value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_i32(&self, coords: &[u16]) -> Result<i32>
[src]
Fetch a single voxel's value in the given voxel index coordinates as a signed 32-bit value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_u64(&self, coords: &[u16]) -> Result<u64>
[src]
Fetch a single voxel's value in the given voxel index coordinates as an unsigned 64-bit value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_i64(&self, coords: &[u16]) -> Result<i64>
[src]
Fetch a single voxel's value in the given voxel index coordinates as a signed 64-bit value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
impl NiftiVolume for InMemNiftiVolume
[src]
fn dim(&self) -> &[u16]
[src]
Get the dimensions of the volume. Unlike how NIFTI-1 stores dimensions, the returned slice does not include dim[0]
and is clipped to the effective number of dimensions. Read more
fn dimensionality(&self) -> usize
[src]
Get the volume's number of dimensions. In a fully compliant file, this is equivalent to the corresponding header's dim[0]
field (with byte swapping already applied). Read more
fn data_type(&self) -> NiftiType
[src]
Get this volume's data type.
fn get_f32(&self, coords: &[u16]) -> Result<f32>
[src]
Fetch a single voxel's value in the given voxel index coordinates as a single precision floating point value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_f64(&self, coords: &[u16]) -> Result<f64>
[src]
Fetch a single voxel's value in the given voxel index coordinates as a double precision floating point value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_u8(&self, coords: &[u16]) -> Result<u8>
[src]
Fetch a single voxel's value in the given voxel index coordinates as an unsigned 8-bit value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_i8(&self, coords: &[u16]) -> Result<i8>
[src]
Fetch a single voxel's value in the given voxel index coordinates as a signed 8-bit value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_u16(&self, coords: &[u16]) -> Result<u16>
[src]
Fetch a single voxel's value in the given voxel index coordinates as an unsigned 16-bit value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_i16(&self, coords: &[u16]) -> Result<i16>
[src]
Fetch a single voxel's value in the given voxel index coordinates as a signed 16-bit value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_u32(&self, coords: &[u16]) -> Result<u32>
[src]
Fetch a single voxel's value in the given voxel index coordinates as an unsigned 32-bit value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_i32(&self, coords: &[u16]) -> Result<i32>
[src]
Fetch a single voxel's value in the given voxel index coordinates as a signed 32-bit value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_u64(&self, coords: &[u16]) -> Result<u64>
[src]
Fetch a single voxel's value in the given voxel index coordinates as an unsigned 64-bit value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more
fn get_i64(&self, coords: &[u16]) -> Result<i64>
[src]
Fetch a single voxel's value in the given voxel index coordinates as a signed 64-bit value. All necessary conversions and transformations are made when reading the voxel, including scaling. Note that using this function continuously to traverse the volume is inefficient. Prefer using iterators or the ndarray
API for volume traversal. Read more