Skip to main content

Python bindings for the ODX format — TRX-style mmap container for ODFs, peaks, and SH coefficients

Project description

odx — Python bindings for the ODX format

Python bindings for odx-rs, a TRX-style mmap-friendly container for orientation density functions (ODFs), peaks, and spherical-harmonic coefficients from diffusion MRI.

Install

pip install odx           # core package (numpy only)
pip install odx[dipy]     # with the dipy adapter for PeaksAndMetrics interop

Quickstart

Compute CSD in dipy, dump to a peaked ODX in one call:

import odx
from dipy.reconst.csdeconv import ConstrainedSphericalDeconvModel
from dipy.direction.peaks import peaks_from_model

# ... fit a model, get csd_fit.shm_coeff (X, Y, Z, K)

peaked = odx.from_sh_coefficients(
    csd_fit.shm_coeff, mask=mask, affine=affine,
    basis="descoteaux07", sh_order=8, legacy=True,
)
peaked.save("csd.odx")              # native, mmap-friendly
peaked.save_fz("autotrack.fz")      # → DSI Studio fz
peaked.save_mrtrix("mrtrix_out/")   # → MRtrix mif (auto-converts basis)

# Round-trip back to dipy if you want
pam = odx.to_peaks_and_metrics(peaked)

Features

  • Native ODX I/O — read/write .odx archives or directories, mmap-backed for zero-copy NumPy views.
  • Peak finder — sphere-mesh local-maxima detection with MRtrix-style Gauss-Newton sub-vertex refinement on the SH series itself.
  • Foreign format converters — load and save DSI Studio (.fz, .fib.gz), MRtrix (fixel directories + .mif), Tortoise MAP-MRI, pyAFQ asymmetric ODFs.
  • dipy adapter (optional) — bidirectional conversion between odx.Odx and dipy's PeaksAndMetrics. Lazy-imported so dipy isn't required for the core package.
  • SH basis conversion — descoteaux07 ↔ tournier07 round-trips via amplitudes, including legacy/modern variants.

License

The bulk of odx-rs (and the Python bindings) is dual-licensed under the MIT and Apache 2.0 licenses, the typical Rust ecosystem dual-license. Pick whichever you prefer.

Two source files in the underlying Rust crate (src/peak_finder.rs and src/mrtrix_sh.rs) port code from MRtrix3 and remain governed by the Mozilla Public License v. 2.0. That's a file-scoped (weak) copyleft — modifications to those specific files must remain MPL and source-available, but the license has no effect on projects that simply use odx as a dependency.

SPDX summary: (MIT OR Apache-2.0) AND MPL-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

odx-0.1.3.tar.gz (325.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

odx-0.1.3-cp39-abi3-win_amd64.whl (4.3 MB view details)

Uploaded CPython 3.9+Windows x86-64

odx-0.1.3-cp39-abi3-musllinux_1_2_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

odx-0.1.3-cp39-abi3-musllinux_1_2_aarch64.whl (3.0 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

odx-0.1.3-cp39-abi3-manylinux_2_28_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ x86-64

odx-0.1.3-cp39-abi3-manylinux_2_28_aarch64.whl (2.7 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

odx-0.1.3-cp39-abi3-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

odx-0.1.3-cp39-abi3-macosx_10_12_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file odx-0.1.3.tar.gz.

File metadata

  • Download URL: odx-0.1.3.tar.gz
  • Upload date:
  • Size: 325.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for odx-0.1.3.tar.gz
Algorithm Hash digest
SHA256 4bfb2642307abfa243b8a28a5ef57d6981457029bbf7fde78bb40a0bbd1ef20b
MD5 4b653b1116b63e06bf9a6183a23a90b0
BLAKE2b-256 1ebdaac9226e0375e6f8a4e93fd49570b9b62c3e63d50a1975c169b8ae17b3f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for odx-0.1.3.tar.gz:

Publisher: release.yml on PennLINC/odx-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file odx-0.1.3-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: odx-0.1.3-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 4.3 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for odx-0.1.3-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 278b67680cdba29f56d86a8b5afca697c92d932abb6342f6337a9bc4e7f0bb25
MD5 992348b42064099642f0b3f5b2b73433
BLAKE2b-256 5de9f8bdb4dd1e40de6ff05f931d05b40ec3e201ff8d9dea5b50f49435f34bd9

See more details on using hashes here.

Provenance

The following attestation bundles were made for odx-0.1.3-cp39-abi3-win_amd64.whl:

Publisher: release.yml on PennLINC/odx-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file odx-0.1.3-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: odx-0.1.3-cp39-abi3-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: CPython 3.9+, musllinux: musl 1.2+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for odx-0.1.3-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 605ce9435563bfd9dcec3275c3f15d812471c20550653210704e6e4b6592fd09
MD5 9a2760b8e56404c2d845ceed036e93d6
BLAKE2b-256 6f51ceab1785cc95d4e6adcfc28833647ffa47503f102615bf98edd396e18ee5

See more details on using hashes here.

Provenance

The following attestation bundles were made for odx-0.1.3-cp39-abi3-musllinux_1_2_x86_64.whl:

Publisher: release.yml on PennLINC/odx-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file odx-0.1.3-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

  • Download URL: odx-0.1.3-cp39-abi3-musllinux_1_2_aarch64.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: CPython 3.9+, musllinux: musl 1.2+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for odx-0.1.3-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 b9d20231ee7963e8a5eb09de8650258fc05da1c26496a7fea07d242823bd705e
MD5 df476654a374957852050836c35637c4
BLAKE2b-256 efb8858d6cc49701c50f1cec9aae7572b48601b95a8cc03f3fb417469b0a9134

See more details on using hashes here.

Provenance

The following attestation bundles were made for odx-0.1.3-cp39-abi3-musllinux_1_2_aarch64.whl:

Publisher: release.yml on PennLINC/odx-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file odx-0.1.3-cp39-abi3-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: odx-0.1.3-cp39-abi3-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: CPython 3.9+, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for odx-0.1.3-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3eaa40e7d7c33ffdc2a89fc49377ee021fd43cc10e12cd574dbb383661c39ee4
MD5 5fee592cca8e587f3fab53422967edb0
BLAKE2b-256 f370adc009761a218397c2cec9a13b6483362ad4ea1c031c3a09b9c3b27a638a

See more details on using hashes here.

Provenance

The following attestation bundles were made for odx-0.1.3-cp39-abi3-manylinux_2_28_x86_64.whl:

Publisher: release.yml on PennLINC/odx-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file odx-0.1.3-cp39-abi3-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: odx-0.1.3-cp39-abi3-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.9+, manylinux: glibc 2.28+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for odx-0.1.3-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 57228d8eaefeb9e5dfb1dc3e375c433857e92a5fc5b0ed3d2d38b04196458d75
MD5 9f3373b913a663ee26fc05800d08b71d
BLAKE2b-256 91a17eef2b4ba681f8290ea35bb6d74c56c0e6cffbc0aebda30c99d833a07731

See more details on using hashes here.

Provenance

The following attestation bundles were made for odx-0.1.3-cp39-abi3-manylinux_2_28_aarch64.whl:

Publisher: release.yml on PennLINC/odx-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file odx-0.1.3-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: odx-0.1.3-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.9+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for odx-0.1.3-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ac2876e50f42e0cb66c5767c8922d70f41377b823005daf2e74d29fa66d83e93
MD5 815d9e5ac1c482ecd462006f781d871e
BLAKE2b-256 9f40ff058b216ea58f7bf9dfbc9c2870a6755f0730d3903b33a756b0c3c9663a

See more details on using hashes here.

Provenance

The following attestation bundles were made for odx-0.1.3-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on PennLINC/odx-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file odx-0.1.3-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: odx-0.1.3-cp39-abi3-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: CPython 3.9+, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for odx-0.1.3-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ac0ecb1dfcbff326fd5e6deced954b2f582b122b401776c607727077e61521c8
MD5 b7ffb29e250e2ec44854ab4fb96a4fe0
BLAKE2b-256 fd6691cd2720b863d65fbecfb295e510dbfdcf733fe61515bedaefd0d9b698da

See more details on using hashes here.

Provenance

The following attestation bundles were made for odx-0.1.3-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on PennLINC/odx-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page