Skip to content

nipy/nibabel

Repository files navigation

NiBabel logo

Code .. image:: https://img.shields.io/pypi/pyversions/nibabel.svg :target: https://pypi.python.org/pypi/nibabel/ :alt: PyPI - Python Version .. image:: https://img.shields.io/badge/code%20style-blue-blue.svg :target: https://blue.readthedocs.io/en/latest/ :alt: code style: blue .. image:: https://img.shields.io/badge/imports-isort-1674b1 :target: https://pycqa.github.io/isort/ :alt: imports: isort .. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white :target: https://github.com/pre-commit/pre-commit :alt: pre-commit
Tests .. image:: https://github.com/nipy/NiBabel/actions/workflows/stable.yml/badge.svg :target: https://github.com/nipy/NiBabel/actions/workflows/stable.yml :alt: stable tests .. image:: https://codecov.io/gh/nipy/NiBabel/branch/master/graph/badge.svg :target: https://codecov.io/gh/nipy/NiBabel :alt: codecov badge
PyPI .. image:: https://img.shields.io/pypi/v/nibabel.svg :target: https://pypi.python.org/pypi/nibabel/ :alt: PyPI version .. image:: https://img.shields.io/pypi/dm/nibabel.svg :target: https://pypistats.org/packages/nibabel :alt: PyPI - Downloads
Packages .. image:: https://img.shields.io/conda/vn/conda-forge/nibabel :target: https://anaconda.org/conda-forge/nibabel :alt: Conda package .. image:: https://repology.org/badge/version-for-repo/debian_unstable/nibabel.svg?header=Debian%20Unstable :target: https://repology.org/project/nibabel/versions :alt: Debian Unstable package .. image:: https://repology.org/badge/version-for-repo/aur/python:nibabel.svg?header=Arch%20%28%41%55%52%29 :target: https://repology.org/project/python:nibabel/versions :alt: Arch (AUR) .. image:: https://repology.org/badge/version-for-repo/gentoo_ovl_science/nibabel.svg?header=Gentoo%20%28%3A%3Ascience%29 :target: https://repology.org/project/nibabel/versions :alt: Gentoo (::science) .. image:: https://repology.org/badge/version-for-repo/nix_unstable/python:nibabel.svg?header=nixpkgs%20unstable :target: https://repology.org/project/python:nibabel/versions :alt: nixpkgs unstable
License & DOI .. image:: https://img.shields.io/pypi/l/nibabel.svg :target: https://github.com/nipy/nibabel/blob/master/COPYING :alt: License .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.591597.svg :target: https://doi.org/10.5281/zenodo.591597 :alt: Zenodo DOI

Read and write access to common neuroimaging file formats, including: ANALYZE (plain, SPM99, SPM2 and later), GIFTI, NIfTI1, NIfTI2, CIFTI-2, MINC1, MINC2, AFNI BRIK/HEAD, ECAT and Philips PAR/REC. In addition, NiBabel also supports FreeSurfer's MGH, geometry, annotation and morphometry files, and provides some limited support for DICOM.

NiBabel's API gives full or selective access to header information (metadata), and image data is made available via NumPy arrays. For more information, see NiBabel's documentation site and API reference.

Installation

To install NiBabel's current release with pip, run:

pip install nibabel

To install the latest development version, run:

pip install git+https://github.com/nipy/nibabel

When working on NiBabel itself, it may be useful to install in "editable" mode:

git clone https://github.com/nipy/nibabel.git
pip install -e ./nibabel

For more information on previous releases, see the release archive or development changelog.

Testing

During development, we recommend using tox to run nibabel tests:

git clone https://github.com/nipy/nibabel.git
cd nibabel
tox

To test an installed version of nibabel, install the test dependencies and run pytest:

pip install nibabel[test]
pytest --pyargs nibabel

For more information, consult the developer guidelines.

Mailing List

Please send any questions or suggestions to the neuroimaging mailing list.

License

NiBabel is licensed under the terms of the MIT license. Some code included with NiBabel is licensed under the BSD license. For more information, please see the COPYING file.

Citation

NiBabel releases have a Zenodo Digital Object Identifier (DOI) badge at the top of the release notes. Click on the badge for more information.