[][src]Struct nifti::object::ReaderStreamedOptions

pub struct ReaderStreamedOptions { /* fields omitted */ }

Options and flags which can be used to configure how a NIfTI image is read and iterated.

Implementations

impl ReaderStreamedOptions[src]

pub fn new() -> ReaderStreamedOptions[src]

Creates a blank new set of options ready for configuration.

All options are initially set to false.

pub fn fix_header(&mut self, fix_header: bool) -> &mut Self[src]

Sets the options to fix some known header problems.

pub fn read_file<P>(
    &self,
    path: P
) -> Result<StreamedNiftiObject<MaybeGzDecodedFile>> where
    P: AsRef<Path>, 
[src]

Retrieve the NIfTI object and prepare the volume for streamed reading.

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, ReaderStreamedOptions};

let obj = ReaderStreamedOptions::new().read_file("minimal.nii.gz")?;

let volume = obj.into_volume();
for slice in volume {
    let slice = slice?;
    // manipulate slice here
}

pub fn read_file_rank<P>(
    &self,
    path: P,
    slice_rank: u16
) -> Result<StreamedNiftiObject<MaybeGzDecodedFile>> where
    P: AsRef<Path>, 
[src]

Retrieve the NIfTI object and prepare the volume for streamed reading, using slice_rank as the dimensionality of each slice.

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.

pub fn read_file_pair<P, Q>(
    &self,
    hdr_path: P,
    vol_path: Q
) -> Result<StreamedNiftiObject<MaybeGzDecodedFile>> where
    P: AsRef<Path>,
    Q: AsRef<Path>, 
[src]

Retrieve a NIfTI object as separate header and volume files, for streamed volume reading.

This method is useful when file names are not conventional for a NIfTI file pair.

Example

use nifti::{NiftiObject, ReaderStreamedOptions};

let obj = ReaderStreamedOptions::new().read_file_pair("abc.hdr", "abc.img.gz")?;

let volume = obj.into_volume();
for slice in volume {
    let slice = slice?;
    // manipulate slice here
}

pub fn read_file_pair_rank<P, Q>(
    &self,
    hdr_path: P,
    vol_path: Q,
    slice_rank: u16
) -> Result<StreamedNiftiObject<MaybeGzDecodedFile>> where
    P: AsRef<Path>,
    Q: AsRef<Path>, 
[src]

Retrieve a NIfTI object as separate header and volume files, for streamed volume reading, using slice_rank as the dimensionality of each slice.

This method is useful when file names are not conventional for a NIfTI file pair.

Trait Implementations

impl Clone for ReaderStreamedOptions[src]

impl Debug for ReaderStreamedOptions[src]

impl PartialEq<ReaderStreamedOptions> for ReaderStreamedOptions[src]

impl StructuralPartialEq for ReaderStreamedOptions[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>,