Registry / ai-ml / dipy
library1.12.1pypypi✓ verified 89d ago

DIPY is a Python library for diffusion MRI analysis, featuring tractography, reconstruction, registration, and signal processing. Current version is 1.12.1. It has a moderate release cadence with major versions every 1-2 years.

pip install dipy
INSTALL
IMPORT
SIG · DIPY
D
dipy
ai-mlpythonv1.12.1
Install
10.9s avg
Import
—
Disk
304MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.12.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✕ build_error
py 3.11
✕ build_error
✓ 10.9s
py 3.12
✕ build_error
✓ 10.9s
py 3.13
✕ build_error
✓ 10.7s
py 3.9
✕ build_error
✓ 11s
304MB installed
● package 304MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

dipy
✓ import dipy
Top-level import works, but specific submodules must be imported explicitly (e.g., from dipy.io import read_bvals_bvecs)
gtab
✓ from dipy.core.gradients import gradient_table
✗ from dipy.io.gradients import read_bvals_bvecs (not for creating gtab)
gradient_table is in core.gradients

Minimal DTI tensor fitting example. Replace file paths with actual data.

import numpy as np from dipy.io import read_bvals_bvecs from dipy.core.gradients import gradient_table from dipy.reconst.dti import TensorModel # Load data (example: replace with own files) # data = nib.load('dwi.nii.gz').get_fdata() # bvals, bvecs = read_bvals_bvecs('bvals.txt', 'bvecs.txt') # gtab = gradient_table(bvals, bvecs) # tenmodel = TensorModel(gtab) # tenfit = tenmodel.fit(data) # fa = tenfit.fa print('DIPY DTI example ready')
dipy --version
Debug
Known issues
breakingDIPY 1.0.0 dropped support for Python 2 and changed many submodule paths. Some previously top-level functions moved to submodules.
fix
Update imports: e.g., from dipy.reconst.dti import TensorModel instead of dipy.dti.TensorModel.
affects: <1.0.0
deprecatedThe `dipy.data` module contains some deprecated fetchers. Prefer using `nibabel` to load data.
fix
Use `nib.load()` directly instead of `dipy.data.get_data()`.
affects: <1.10.0
gotchagradient_table expects b-values in s/mm² and b-vectors as (N,3) array. Mixing units or shapes causes silent errors.
fix
Ensure bvals are numeric, bvecs are normalized, and use correct order: gradient_table(bvals, bvecs, b0_threshold=50).
affects: all
gotchaDIPY's tractography algorithms (e.g., EuDX) require specific input formats. Incorrect seed masks can lead to empty streamlines.
fix
Check seed mask is binary and in same space as data. Use dipy.tracking.utils seeds_from_mask.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'dipy.dti'
Import path changed after DIPY 1.0.0; old top-level submodules no longer exist.
fix
Use from dipy.reconst.dti import TensorModel instead.
AttributeError: module 'dipy' has no attribute 'data'
dipy.data is not automatically imported; need to import explicitly.
fix
Try from dipy.data import get_data or import dipy.data as dpd.
ValueError: bvals and bvecs must have same number of volumes
bvals and bvecs files have mismatched lengths or are not aligned properly.
fix
Read both files with read_bvals_bvecs and verify shapes. Ensure they correspond to the same DW images.
Upgrade
Version history
1.12.1latest on PyPI · released Apr 23, 2026
Audit
Dependencies
numpyrequiredCore array operations
scipyrequiredScientific computing
nibabelrequiredNeuroimaging file I/O
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources