Struct nifti::object::ReaderOptions
source · pub struct ReaderOptions { /* private fields */ }
Expand description
Options and flags which can be used to configure how a NIfTI image is read.
Implementations§
source§impl ReaderOptions
impl ReaderOptions
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a blank new set of options ready for configuration.
All options are initially set to false
.
sourcepub fn fix_header(&mut self, fix_header: bool) -> &mut Self
pub fn fix_header(&mut self, fix_header: bool) -> &mut Self
Sets the options to fix some known header problems.
sourcepub fn read_file<P>(&self, path: P) -> Result<InMemNiftiObject>where
P: AsRef<Path>,
pub fn read_file<P>(&self, path: P) -> Result<InMemNiftiObject>where P: AsRef<Path>,
Retrieve the full contents of a NIFTI object.
The given file system path is used as reference. If the file only contains the header, this method will look for the corresponding file with the extension “.img”, or “.img.gz” if the former wasn’t found.
Example
use nifti::{NiftiObject, ReaderOptions};
let obj = ReaderOptions::new().read_file("minimal.nii.gz")?;
sourcepub fn read_file_pair<P, Q>(
&self,
hdr_path: P,
vol_path: Q
) -> Result<InMemNiftiObject>where
P: AsRef<Path>,
Q: AsRef<Path>,
pub fn read_file_pair<P, Q>( &self, hdr_path: P, vol_path: Q ) -> Result<InMemNiftiObject>where P: AsRef<Path>, Q: AsRef<Path>,
Retrieve a NIFTI object as separate header and volume files.
This method is useful when file names are not conventional for a NIFTI file pair.
Trait Implementations§
source§impl Clone for ReaderOptions
impl Clone for ReaderOptions
source§fn clone(&self) -> ReaderOptions
fn clone(&self) -> ReaderOptions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ReaderOptions
impl Debug for ReaderOptions
source§impl Default for ReaderOptions
impl Default for ReaderOptions
source§fn default() -> ReaderOptions
fn default() -> ReaderOptions
Returns the “default value” for a type. Read more
source§impl PartialEq<ReaderOptions> for ReaderOptions
impl PartialEq<ReaderOptions> for ReaderOptions
source§fn eq(&self, other: &ReaderOptions) -> bool
fn eq(&self, other: &ReaderOptions) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ReaderOptions
Auto Trait Implementations§
impl RefUnwindSafe for ReaderOptions
impl Send for ReaderOptions
impl Sync for ReaderOptions
impl Unpin for ReaderOptions
impl UnwindSafe for ReaderOptions
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
Mutably borrows from an owned value. Read more
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>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.