Skip to content

Releases: Enet4/nifti-rs

v0.8.0

12 Jul 19:23
Compare
Choose a tag to compare

Changes

  • The default values of NiftiHeader have changed. Consider checking your header creation routines with the following changes:
field before now
pixdim [0.; 8] [1.; 8]
sform_code 0 1
qform_code 0 1
srow_x [0.; 4] [1., 0., 0., 0.]
srow_y [0.; 4] [0., 1., 0., 0.]
srow_z [0.; 4] [0., 0., 1., 0.]
  • Removed NiftiHeaderBuilder entirely, as it was not very useful and confusing to work with. Instead, create a default NiftiHeader and mutate it to shape.
  • Deprecate all associated functions named from_stream in favor of from_reader, so as to make it clear that this is a synchronous byte stream, and not an asynchronous future-based stream.
  • NiftiVolume trait has been split. Methods for reading voxel values by index are in RandomAccessNiftiVolume.
  • nalgebra dependencies were updated for users of the nalgebra_affine feature (alga = 0.9.0, nalgebra = 0.18.0)

New

  • New Streamed Volume API, for reading volumes from disk slice by slice, thus saving memory. See StreamedNiftiVolume and StreamedNiftiObject.
  • Dim and Idx helper structs are available in the volume::shape module, for efficiently describing volume shapes and multi-dimensional indices. They are public, but not used by any other public interfaces at the moment.

Other

  • Test resources were excluded from the crate; should lead to a faster crate download.
  • Updated safe-transmute for additional memory safety.
  • Migrated code base to the 2018 edition.

v0.7.0

22 Feb 19:56
Compare
Choose a tag to compare

Changes

  • The byteordered crate is now used for specifying the file's byte order (i.e. Endianness type is from byteordered rather than a built-in type, with a slightly different API). #37
  • NiftiHeader assumes the system's native byte order by default, regardless of whether it was built with NiftiHeader::default() or via the builder. #40
  • More error variants to NiftiError were added.

New

  • Functions for writing an ndarray to a NIfTI file are now available, supporting most simple element types as well as RGB volumes. #21
  • Public methods NiftiHeader::dimensionality() and NiftiHeader::dim(), providing a validated shape of the expected volume. #43

Other

  • Fix crash when reading a volume accompanied by an inconsistent dim header. #43
  • Other minor fixes and tweaks: #20 #30 #36
  • Multiple dependency updates.

v0.6.0

17 Oct 10:50
Compare
Choose a tag to compare

Breaking changes

  • The byte order of the data is now embedded into NiftiHeader (endianness attribute). Constructors return only the header instead of a tuple. #14
  • NiftiError type contains two new variants: IncompatibleLength and InvalidCode.
  • Some methods were renamed to comply with naming guidelines. (#17) Deprecated function calls in your code must be updated before 0.7.0, when they will be removed.
    • InMemNiftiVolume::to_raw_data is deprecated in favour of into_raw_data
    • InMemNiftiVolume::get_raw_data and InMemNiftiVolume::get_raw_data_mut are deprecated, use InMemNiftiVolume::raw_data and InMemNiftiVolume::raw_data_mut instead
    • IntoNdarray::to_ndarray is deprecated. Consumers should only call and implement into_ndarray instead.
  • Validated enum types in the typedef module now have their methods called by value (self) rather than by reference (&self). #18

New

  • Volume constructor InMemNiftiVolume::from_raw_data. #16 (by @nilgoyette)
  • NiftiHeader getters for retrieving validated header information intent, data_type, slice_order, sform, qform and xyzt_units #18

Other changes

  • Optimized memory representation for types in the typedef module (they only need as much as the sizes according to the original NIfTI-1 header).
  • Optimize volume name resolution from header file #20
  • Updated derive_builder dependency #13

v0.5.1

04 Sep 14:22
Compare
Choose a tag to compare

New

  • Added support for ndarray 0.12 with the ndarray_volumes feature (previous version ranges are still supported)

Misc

  • The documentation related to the use of ndarray has been revamped. It should hopefully be much clearer now.
  • Public dependency num has been updated to 0.2.0. num-traits 0.1.43 is forward compatible thanks to the semver trick, so this should not represent a breaking change (or a serious one, if anything).

v0.5.0

18 Feb 15:42
Compare
Choose a tag to compare

Additions

  • New data element API, containing low-level primitives for reading, writing, converting and transforming data elements in a volume.

Breaking Changes

  • Obtaining an ndarray requires the element type T some new constraints related to a data element. Namely, it must be convertible to and from various primitive types through num_traits::AsPrimitive, and implement DataElement. These are already implemented for primitive types. On the other hand, it no longer depends on safe_transmute::PodTransmutable or asprim::AsPrim.

v0.4.1

11 Jan 13:27
Compare
Choose a tag to compare

Fixes

  • Removed extraneous println! calls in library code

v0.4.0

15 Dec 17:38
Compare
Choose a tag to compare

New Features

  • Volumes of any primitive internal type can be transformed to an ndarray of any other primitive type. #5

Breaking Changes

  • IntoNdArray trait requires the parameter T to implement safe_transmute::PodTransmutable, a locked trait. This might change in future versions.

v0.2.1

04 Oct 21:29
Compare
Choose a tag to compare

Breaking changes:

  • to_ndarray() method is now in trait IntoNdArray, which needs to be included (use nifti::IntoNdArray;).

New:

  • New Sliceable and slice APIs for retrieving a view over a volume's slice.
  • SliceView, generic implementation of a slice which works for any NiftiVolume and only fetches data lazily.
  • Support for reading Float32 volumes and turning them into ndarrays. (#1)
  • Reading NIfTI object from a file pair is now more flexible (.hdr + .img.gz is supported).

Bug fixes:

  • Fixed InMemNiftiVolume::get_f32 for data types other than byte-sized (related: #1)