Skip to main content

nibabel-stubs

Type stubs for nibabel, a Python package for reading and writing neuroimaging file formats.

Installation

pip install nibabel-stubs

Usage

Once installed, type checkers like mypy, pyright, and IDEs like PyCharm and VS Code will automatically use these type stubs when you use nibabel in your code.

Example:

import nibabel as nib

# Type checkers will now understand nibabel's API
img = nib.load("example.nii.gz")
data = img.get_fdata()
affine = img.affine
header = img.header

What's Included

This package provides type hints for:

  • Nifti1Image and Nifti1Header classes
  • load() and save() functions
  • affines module utilities
  • orientations module utilities
  • Common nibabel operations with proper numpy array typing

Requirements

  • Python >= 3.7
  • numpy (for numpy.typing support)

Development

To contribute or modify these stubs:

  1. Clone the repository
  2. Edit nibabel-stubs/__init__.pyi
  3. Test with your type checker:
    mypy your_test_file.py
    

License

See LICENSE.md for details.

Compatibility

These stubs are designed to work with nibabel's public API. If you find any issues or missing definitions, please open an issue or submit a pull request.

Metadata

Release files for nibabel-stubs 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nibabel-stubs 0.1.0
File Size Uploaded
nibabel_stubs-0.1.0.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nibabel-stubs 0.1.0
File Interpreter ABI Platform
nibabel_stubs-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.5 kB

Release files / nibabel_stubs-0.1.0.tar.gz

Download URL nibabel_stubs-0.1.0.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a19ed78135328786313164a602527dc7a653b8357e4af11ec4d6c42dd1e9c2f7
BLAKE2b-256 checksum
How to use checksums
ab0d65e2cce41dd61beea2c4b4514675f9435128abdc6d913c0eb148989b4947
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / nibabel_stubs-0.1.0-py3-none-any.whl

Download URL nibabel_stubs-0.1.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b58a8732d976de79b2c7aaf8ca009294ba5360fe9332ccff206f92b4c08b2a35
BLAKE2b-256 checksum
How to use checksums
d9da606a220f74d000a714eb716fe484256a81b3e98040ddbf20d83634623b01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page