skillfed

nibabel

Access a multitude of neuroimaging data formats

nibabel v5.4.2 2.0M downloads/30d#3,409 on PyPI785
Permissive license MIT Active released

What it is and what it does

NiBabel is a Python library for reading and writing neuroimaging data files in a wide range of formats used in brain imaging research. It abstracts the complexity of different file formats—from NIfTI and ANALYZE to FreeSurfer MGH and AFNI BRIK/HEAD—into a unified API, allowing researchers to load image metadata and pixel data as NumPy arrays for downstream analysis.

The library is designed for neuroscience and medical imaging workflows where data often comes in proprietary or specialized formats. It handles both the structural metadata (header information) and the raw image arrays, making it a foundational tool for preprocessing pipelines, statistical analysis, and format conversion in neuroimaging research.

Use it for:

  • Load fMRI or structural MRI scans from NIfTI files for statistical analysis or visualization in research pipelines.
  • Convert between neuroimaging formats (e.g., DICOM to NIfTI) for compatibility with downstream tools.
  • Access FreeSurfer surface geometry and morphometry data for cortical analysis.
  • Extract and manipulate brain imaging metadata (voxel size, affine transforms, acquisition parameters) for quality control.
  • Build automated neuroimaging workflows that read multiple format types without format-specific parsing code.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

NiBabel reads and writes neuroimaging file formats including NIfTI, ANALYZE, GIFTI, CIFTI-2, MINC, AFNI BRIK/HEAD, ECAT, Philips PAR/REC, and FreeSurfer MGH files, exposing metadata and image data via NumPy arrays.

Yes. NiBabel is a stable, actively maintained library with no known vulnerabilities, low install friction, and permissive licensing. It is the de facto standard for neuroimaging file I/O in Python and essential for anyone working with brain imaging data in research or clinical contexts.

Install

nibabel on PyPI

pip

pip install nibabel

uv

uv add nibabel

poetry

poetry add nibabel

Installing nibabel

Before you install

Low friction install with four lightweight runtime dependencies (numpy, packaging, importlib-resources, typing-extensions). Active maintenance with a recent release (156 days ago) and ongoing repository activity.

License in practice

MIT license permits commercial and private use with minimal restrictions; some bundled code uses BSD license. See COPYING file for full details.

Quickstart

pip install nibabel

import nibabel as nib
img = nib.load('scan.nii.gz')
data = img.get_fdata()

Requires Python 3.10 or later.

Verify before relying

  • Whether the package handles all listed formats with equal completeness or if some are read-only or have limited support beyond what 'limited support for DICOM' indicates.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 4 — importlib-resources, numpy, packaging, typing-extensions
Maintenance actively maintained — 156 days since the last release
Last repo commit
First released
Downloads 1,957,737/month — #3,409 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: nibabel-5.4.2-py3-none-any.whl

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering

Tags

neuroimaging file format readernifti dicom medical imagingbrain mri data accessfmri data loadermedical image format conversionfreesurfer mgh readerneuroimaging data io
neuroimagingmedical-imagingfile-io

More Scientific/Engineering packages