Enum nifti::error::NiftiError
source · #[non_exhaustive]pub enum NiftiError {
Show 16 variants
InvalidFormat,
InconsistentDim(u8, u16),
OutOfBounds(Vec<u16>),
AxisOutOfBounds(u16),
MissingVolumeFile(IOError),
NoVolumeData,
IncorrectVolumeDimensionality(u16, u16),
BadVolumeSize,
UnsupportedDataType(NiftiType),
Io(IOError),
IncompatibleLength(usize, usize),
IncorrectDescriptionLength(usize),
InvalidCode(&'static str, i16),
ReserveVolume(usize, TryReserveError),
ReserveExtended(usize, TryReserveError),
InvalidTypeConversion(NiftiType, &'static str),
}
Expand description
Error type for all error variants originated by this crate.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidFormat
An invalid NIfTI-1 file was parsed.
This is detected when reading the file’s magic code,
which should be either b"ni1\0"
or b"n+1\0
.
InconsistentDim(u8, u16)
The field dim
is in an invalid state, as a consequence of
dim[0]
or one of the elements in 1..dim[0] + 1
not being
positive.
OutOfBounds(Vec<u16>)
Attempted to read volume outside boundaries.
AxisOutOfBounds(u16)
Attempted to read a volume over a volume’s unexistent dimension.
MissingVolumeFile(IOError)
Could not retrieve a volume file based on the given header file.
NoVolumeData
An attempt to read a complete NIFTI-1 object from a header file was made. It can also be triggered when a NIFTI object contains the magic code “ni-1\0”, even if the following bytes contain the volume.
IncorrectVolumeDimensionality(u16, u16)
An incorrect number of dimensions was provided when interacting with a volume.
BadVolumeSize
Inconsistent or unsupported volume size (due to one or more dimensions being too large).
UnsupportedDataType(NiftiType)
This voxel data type is not supported. Sorry. :(
Io(IOError)
I/O Error
IncompatibleLength(usize, usize)
Raw data buffer length and volume dimensions are incompatible
IncorrectDescriptionLength(usize)
Description length must be lower than or equal to 80 bytes
InvalidCode(&'static str, i16)
Header contains a code which is not valid for the given attribute
ReserveVolume(usize, TryReserveError)
Could not reserve enough memory for volume data
ReserveExtended(usize, TryReserveError)
Could not reserve enough memory for extended data
InvalidTypeConversion(NiftiType, &'static str)
Attempted a type conversion that is not supported by this crate
Trait Implementations§
source§impl Debug for NiftiError
impl Debug for NiftiError
source§impl Display for NiftiError
impl Display for NiftiError
source§impl Error for NiftiError
impl Error for NiftiError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl From<Error> for NiftiError
impl From<Error> for NiftiError
source§fn from(err: IOError) -> NiftiError
fn from(err: IOError) -> NiftiError
Auto Trait Implementations§
impl !RefUnwindSafe for NiftiError
impl Send for NiftiError
impl Sync for NiftiError
impl Unpin for NiftiError
impl !UnwindSafe for NiftiError
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
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.