Type Definition nifti::object::StreamedNiftiObject

source ·
pub type StreamedNiftiObject<R> = GenericNiftiObject<StreamedNiftiVolume<R>>;
Expand description

A NIfTI object containing a streamed volume.

Implementations§

source§

impl StreamedNiftiObject<MaybeGzDecodedFile>

source

pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>

👎Deprecated since 0.10.0: use read_file from ReaderStreamedOptions instead

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

let obj = StreamedNiftiObject::from_file("minimal.nii.gz")?;

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

pub fn from_file_rank<P: AsRef<Path>>(path: P, slice_rank: u16) -> Result<Self>

👎Deprecated since 0.10.0: use read_file_rank from ReaderStreamedOptions instead

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.

source

pub fn from_file_pair<P, Q>(hdr_path: P, vol_path: Q) -> Result<Self>where P: AsRef<Path>, Q: AsRef<Path>,

👎Deprecated since 0.10.0: use read_file_pair from ReaderStreamedOptions instead

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

let obj = StreamedNiftiObject::from_file_pair("abc.hdr", "abc.img.gz")?;

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

pub fn from_file_pair_rank<P, Q>( hdr_path: P, vol_path: Q, slice_rank: u16 ) -> Result<Self>where P: AsRef<Path>, Q: AsRef<Path>,

👎Deprecated since 0.10.0: use read_file_pair_rank from ReaderStreamedOptions instead

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.