Crate nifti[−][src]
Rust implementation of the NIfTI-1 file format.
Example
use nifti::{NiftiObject, InMemNiftiObject, NiftiVolume}; let obj = InMemNiftiObject::from_file("myvolume.nii.gz")?; // use obj let header = obj.header(); let volume = obj.volume(); let dims = volume.dim();
The library will automatically look for the respective volume when specifying just the header file:
use nifti::{NiftiObject, InMemNiftiObject}; let obj = InMemNiftiObject::from_file("myvolume.hdr.gz")?;
With the ndarray_volumes
Cargo feature enabled, you can also convert a
volume to an ndarray::Array
and work from
there:
use nifti::IntoNdArray; let volume = obj.into_volume().into_ndarray::<f32>()?;
Re-exports
pub use error::NiftiError; |
pub use error::Result; |
pub use object::NiftiObject; |
pub use object::InMemNiftiObject; |
pub use extension::Extender; |
pub use extension::Extension; |
pub use extension::ExtensionSequence; |
pub use header::NiftiHeader; |
pub use header::NiftiHeaderBuilder; |
pub use volume::NiftiVolume; |
pub use volume::InMemNiftiVolume; |
pub use volume::Sliceable; |
pub use volume::element::DataElement; |
pub use typedef::NiftiType; |
pub use typedef::Unit; |
pub use typedef::Intent; |
pub use typedef::XForm; |
pub use typedef::SliceOrder; |
Modules
error |
Types for error handling go here. |
extension |
This module contains definitions for the extension and related types. Extensions are optional data frames sitting before the voxel data. When present, an extender frame of 4 bytes is also present at the end of the NIFTI-1 header, with the first byte set to something other than 0. |
header |
This module defines the |
object |
Module for handling and retrieving complete NIFTI-1 objects. |
typedef |
This module contains multiple types defined by the standard.
At the moment, not all of them are used internally ( |
volume |
This module defines the voxel volume API, as well as data
types for reading volumes from files.
An integration with |
Enums
Endianness |
Enumerate for the two kinds of endianness possible by the standard. |