Releases: Enet4/nifti-rs
Releases · Enet4/nifti-rs
v0.8.0
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 defaultNiftiHeader
and mutate it to shape. - Deprecate all associated functions named
from_stream
in favor offrom_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 inRandomAccessNiftiVolume
.nalgebra
dependencies were updated for users of thenalgebra_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
andStreamedNiftiObject
. Dim
andIdx
helper structs are available in thevolume::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
Changes
- The
byteordered
crate is now used for specifying the file's byte order (i.e.Endianness
type is frombyteordered
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 withNiftiHeader::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()
andNiftiHeader::dim()
, providing a validated shape of the expected volume. #43
Other
v0.6.0
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
andInvalidCode
.- 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 ofinto_raw_data
InMemNiftiVolume::get_raw_data
andInMemNiftiVolume::get_raw_data_mut
are deprecated, useInMemNiftiVolume::raw_data
andInMemNiftiVolume::raw_data_mut
insteadIntoNdarray::to_ndarray
is deprecated. Consumers should only call and implementinto_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 informationintent
,data_type
,slice_order
,sform
,qform
andxyzt_units
#18
Other changes
v0.5.1
New
- Added support for
ndarray
0.12 with thendarray_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
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 throughnum_traits::AsPrimitive
, and implementDataElement
. These are already implemented for primitive types. On the other hand, it no longer depends onsafe_transmute::PodTransmutable
orasprim::AsPrim
.
v0.4.1
v0.4.0
v0.2.1
Breaking changes:
to_ndarray()
method is now in traitIntoNdArray
, 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 anyNiftiVolume
and only fetches data lazily.- Support for reading Float32 volumes and turning them into
ndarray
s. (#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)