5.0.0
New feature release in the 5.0.x series.
Most work on NiBabel so far has been by Matthew Brett (MB), Chris Markiewicz (CM), Michael Hanke (MH), Marc-Alexandre Côté (MC), Ben Cipollini (BC), Paul McCarthy (PM), Chris Cheng (CC), Yaroslav Halchenko (YOH), Satra Ghosh (SG), Eric Larson (EL), Demian Wassermann, Stephan Gerhard and Ross Markello (RM).
New features
SerializableImagenow hasto_stream()andfrom_stream()methods to read/write streams implementing theio.IOBaseinterface. Afrom_url()method enables loading images from URLs. (pr/1129) (CM, reviewed by MB)TrkFilesupports TRKv3, an undocumented but generally compatible variant of TRKv2. (pr/1125) (CM)
Enhancements
- Support multiline header fields in
TCKFile(pr/1175) (CM, reviewed by Matt Cieslak) - Make layout order an initialization parameter of
ArrayProxy(pr/1131) (CM, reviewed by MB) - Initial support for type annotations. (pr/1115, pr/1178) (CM, reviewed by Zvi Baratz)
Bug fixes
- Handle extension/file-format mismatches implemented incompletely in pr/1013 (pr/1138) (CM, reviewed by Thomas Phil)
- Improve handling of invalid TCK files, which could sometimes cause an infinite loop (pr/1140) (Anibal Solon, reviewed by CM)
- Clean up ECAT test case that left filehandle open and failed to use class variables (pr/1155) (Dimitri Papadopoulos, reviewed by CM)
Maintenance
- Simplify TCK reading code by assuming files are open in binary mode (pr/1142) (Anibal Solon, reviewed by MC, CM)
- Code support for tests covering deprecated functionality (pr/1159) (CM)
- Miscellaneous code cleanups (pr/1148, pr/1149, pr/1153, pr/1154, pr/1156) (Dimitri Papadopoulos, reviewed by CM)
- Update CI to build, test and deploy PyPI artifacts (pr/1134) (CM, reviewed by MB)
- Transition from
setup.cfgtopyproject.tomlpackage configuration (pr/1133) (CM, reviewed by MB) - Addressed race conditions preventing running tests with pytest-xdist. (pr/1157, pr/1158) (CM, reviewed by Christian Haselgrove)
- Apply blue and isort auto-formatters and provide pre-commit configuration to reduce human burden of style guidelines. (pr/1124, pr/1165, pr/1169) (CM and Zvi Baratz)
- Manage versioning with setuptools_scm (pr/1171) (CM, reviewed by Zvi Baratz)
- Reduce installed package size by excluding very large test file (pr/1176) (CM, reviewed by Zvi Baratz)
API changes and deprecations
-
Passing an
int64array toNifti1Imagewithout a header or dtype argument will raise aValueError. (pr/1173) (CM) -
tmpdirs.TemporaryDirectoryis deprecated in favor oftempfile.TemporaryDirectory. (pr/1172) (CM, reviewed by Zvi Baratz) -
The
nisextpackage is deprecated and will be removed in NiBabel 6.0. (pr/1170) (CM, reviewed by MB) -
Drop support for Python 3.7, Numpy < 1.19 (pr/1177) (CM)
-
The following deprecated functions and methods will now raise
ExpiredDeprecationErrorsnibabel.loadsave.read_img_datanibabel.dataobj_images.DataobjImage.get_datanibabel.loadsave.guessed_image_typenibabel.onetime.setattr_on_readnibabel.orientations.flip_axis
-
Modules, classes and functions that expired at 4.0 were fully removed.
ExpiredDeprecationError\s will now beAttributeError\s.