Struct nifti::volume::inmem::InMemNiftiVolume [−][src]
pub struct InMemNiftiVolume { /* fields omitted */ }
Expand description
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
Build an InMemNiftiVolume from a header and a buffer. The buffer length and the dimensions declared in the header are expected to fit.
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
.
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).
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.
Retrieve the raw data, consuming the volume.
Retrieve a mutable reference to the raw data.
Trait Implementations
Read a NIfTI volume from a stream of raw voxel data. The header and expected byte order of the volume’s data must be known in advance. It is also expected that the following bytes represent the first voxels of the volume (and not part of the extensions). Read more
Consume the volume into an ndarray.
Create an ndarray from the given volume.
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
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
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
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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Auto Trait Implementations
impl RefUnwindSafe for InMemNiftiVolume
impl Send for InMemNiftiVolume
impl Sync for InMemNiftiVolume
impl Unpin for InMemNiftiVolume
impl UnwindSafe for InMemNiftiVolume
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
Checks if self
is actually part of its subset T
(and can be converted to it).
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
The inclusion map: converts self
to the equivalent element of its superset.