nifti

Crates.ionifti
lib.rsnifti
version0.16.0
sourcesrc
created_at2017-05-25 16:50:01.738111
updated_at2023-07-05 20:08:57.337847
descriptionRust implementation of the NIfTI file format
homepage
repositoryhttps://github.com/Enet4/nifti-rs
max_upload_size
id15937
size275,358
Eduardo Pinho (Enet4)

documentation

https://docs.rs/crate/nifti

README

NIFTI-rs   Latest Version Continuous integration status dependency status

This library is a pure Rust implementation for reading files in the NIfTI format (more specifically NIfTI-1.1).

Example

Please see the documentation for more.

use nifti::{NiftiObject, ReaderOptions, NiftiVolume};

let obj = ReaderOptions::new().read_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, ReaderOptions};

let obj = ReaderOptions::new().read_file("myvolume.hdr.gz")?;

With the ndarray_volumes feature (enabled by default), you can also convert a volume to an ndarray::Array and work from there:

let volume = obj.into_volume().into_ndarray::<f32>();

In addition, the nalgebra_affine feature unlocks the affine module, for useful affine transformations.

Roadmap

This library should hopefully fulfil a good number of use cases. However, not all features of the format are fully available. There are no deadlines for these features, so your help is much appreciated. Please visit the issue tracker and tracker for version 1.0. In case something is missing for your use case to work, please find an equivalent issue of file a new one. Pull requests are also welcome.

License

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 417

cargo fmt