Skip to main content

Helper library and interactive anywidgets for the DartBrains fMRI course

Project description

dartbrains-tools

Helper library and interactive anywidgets for the DartBrains fMRI course. Extracted from the book repo so the widgets and helpers can be installed standalone — including in molab and pyodide/WASM marimo notebooks.

Install

pip install dartbrains-tools

# Optional: include marimo for notebook_utils.youtube()
pip install "dartbrains-tools[notebook]"

Modules

  • dartbrains_tools.data — load the Pinel Localizer dataset from the Hugging Face Hub.
  • dartbrains_tools.mr_simulations — Bloch equation solvers, signal generators, HRF, and Plotly visualization helpers.
  • dartbrains_tools.mr_widgets — 10 anywidgets for interactive MR physics teaching (PrecessionWidget, SpinEnsembleWidget, KSpaceWidget, ConvolutionWidget, EncodingWidget, CompassWidget, NetMagnetizationWidget, TransformCubeWidget, CostFunctionWidget, SmoothingWidget).
  • dartbrains_tools.notebook_utils — small marimo helpers (youtube).

Quick start

from dartbrains_tools.mr_widgets import PrecessionWidget

w = PrecessionWidget(b0=3.0, flip_angle=90.0)
w  # Interactive 3D Three.js animation in any anywidget host.
from dartbrains_tools.data import get_subjects, get_file, load_events

subjects = get_subjects()
bold = get_file("S01", "bold")
events = load_events("S01")

Development

git clone https://github.com/ljchang/dartbrains-tools
cd dartbrains-tools
uv sync
uv run pytest
uv build

License

MIT. The parent course materials at dartbrains remain CC-BY-SA-4.0; this companion library is permissive so it can be reused in any downstream project.

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

dartbrains_tools-0.1.0.tar.gz (35.9 kB view details)

Uploaded Source

Built Distribution

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

dartbrains_tools-0.1.0-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

Details for the file dartbrains_tools-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for dartbrains_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5c48a47ec247a1d95baafcbed3c96b73e0c52fb5f329bedd41b0c291c421c3d1
MD5 7ff650416b177564fc533892e6ba40fe
BLAKE2b-256 36ea5eb4deaaa5386d604c9b68c05b3a5b4245e3d0696fff6b9db8049db3b208

See more details on using hashes here.

Provenance

The following attestation bundles were made for dartbrains_tools-0.1.0.tar.gz:

Publisher: publish.yml on ljchang/dartbrains-tools

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

File details

Details for the file dartbrains_tools-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dartbrains_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e56462a5fd8b5f31bd20751e405a092d5c971f133f2407c1e7cd80e628fdb27
MD5 82ce6ae5aa4c45c8c08df652fe50701c
BLAKE2b-256 5be0036f668294ae0ec95b17c83d9bd873f69983a0b0cc7109cd7dd5ca9a89b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for dartbrains_tools-0.1.0-py3-none-any.whl:

Publisher: publish.yml on ljchang/dartbrains-tools

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