--- id: nibabel version: "5.4.2" license: MIT license_treatment: permissive maintenance: active --- # nibabel — Access a multitude of neuroimaging data formats License: permissive · Maintenance: active · Downloads: 2.0M/mo ## 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 above — 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 pip install nibabel uv add nibabel 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_current - Install friction: low - Maintenance: active - Downloads: 2.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags neuroimaging file format reader, nifti dicom medical imaging, brain mri data access, fmri data loader, medical image format conversion, freesurfer mgh reader, neuroimaging data io, neuroimaging, medical-imaging, file-io [View on SkillFed](https://skillfed.io/packages/nibabel) · [View on PyPI](https://pypi.org/project/nibabel/)