Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Render of a non-skull stripped MNI Template

Neurovolume is a Python library for manipulating and visualizing volumetric data. It includes a custom-built, scientific data-focused, VDB writer. The VDB writer is written in Zig with no external dependencies.

While this project focuses on neuroscience, it includes ndarray to VDB to support virtually any volumetric data pipeline.

This project is under active development and might not have everything you need. Please reference reference our roadmap to see what is in the works!

This project is available as a pre-release alpha on pypi. Presently it is only available for arm64. More operating systems coming soon!

🏗️ Building

If you are building locally, we use uv to build and test the project:

uv run python -m ziglang build && uv run pytest tests -s

This is how you might overlay a BOLD sequence onto an anatomical scan:

# acquire arrays and fps from the nibable image (see test_integration.py)

bold_diff = nv.Channel(
    "bold",
    sub(nv.prep_ndarray(bold_arr)),
    transform=bold_affine,
    source_fps=fps,
    playback_fps=24,
    speed=1,
    interpolation=nv.modes.Interpolation.direct,
)
t1 = nv.Channel(
    "t1",
    nv.prep_ndarray(t1_arr),
    transform=t1_affine,
    num_source_frames=bold_diff.num_output_frames,
    interpolation=nv.modes.Interpolation.frozen,
    prune=np.float32(0.1),
)

save_config = nv.SaveConfig("fmri_bold_sub_fade", folder=vdb_out / "fmri_seq")
fmri = nv.Sequence([bold_diff, t1], save_config)
fmri.write()

See tests/test_integration.py for more examples.

Higher sparsity amounts will result in better performance and lower disk space usage. However, after a certain point, they begin to degrade the VDB quality.

📀 Projects

  • BoldViz: a Blender plugin for fMRI and MRI visualizations. It was used to create the renders in this README. A great place to start if you don't want to deal with writing any Python.
  • Neurovolume Examples and Physarum include some good starting points for how one might use this library with numpy.
  • The nibabel example shows how to use an external NIfTI parser, which could be of use for not-yet-supported filetypes. We're moving away from native file parsing as everyone seems to use numpy, but please reach out if this is something that you'd want!

☁️ Why VDB?

VDBs are a highly performant, art-directable, sparse volumetric data structure. Our volume-based approach aims to provide easy access to the original density data throughout the visualization and analysis pipeline. Unlike the openVDB repo, our smaller version is much more readable and does not need to be run in a docker container.

🧠 Dataset Citation

This software was tested using the following datasets.

Isaac David and Victor Olalde-Mathieu and Ana Y. Martínez and Lluviana Rodríguez-Vidal and Fernando A. Barrios (2021). Emotion Category and Face Perception Task Optimized for Multivariate Pattern Analysis. OpenNeuro. [Dataset] doi: 10.18112/openneuro.ds003548.v1.0.1

OpenNeuro Study Link

Direct Download Link for T1 Anat test file

Direct Download Link for BOLD test file

The MNI Template can be found Here

Metadata

Release files for neurovolume 0.1.0a20

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

Source distribution (sdist)

Source distribution for neurovolume 0.1.0a20
File Size Uploaded Provenance Actions
neurovolume-0.1.0a20.tar.gz 522.3 kB Without provenance Details for neurovolume-0.1.0a20.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for neurovolume 0.1.0a20
File Interpreter ABI Platform Actions
neurovolume-0.1.0a20-py3-none-any.whl Python 3 none any Details for neurovolume-0.1.0a20-py3-none-any.whl

Total release size: 1.0 MB

Release files / neurovolume-0.1.0a20.tar.gz

Download URL neurovolume-0.1.0a20.tar.gz
Size 522.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bd0ff6c18dff7c6cf9497b52f9e3d6dad228b868d9eee81e704a2e9b3596c7c4
BLAKE2b-256 checksum
How to use checksums
16e58105f4d5557e62d66ede1347a9bf74749f6055cd03f1afbc0e72fe392638
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / neurovolume-0.1.0a20-py3-none-any.whl

Download URL neurovolume-0.1.0a20-py3-none-any.whl
Size 521.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
587c071497c99a311e6dd9c7287edbd9bc933d823f06192948431d765ccd4a39
BLAKE2b-256 checksum
How to use checksums
0e80aae46b0d34982b343f62a4e05ce84b2f8f8488fec88c8946041d6b158e4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for neurovolume 0.1.0a20

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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