Skip to main content

bsplot Sagittal volume animation Surface rotation animation

Neuroscience plotting utilities built on matplotlib.

Overview

  • Brain surfaces and glass-brain visualizations
  • Volume slicing with anatomical overlays
  • Tractography rendering
  • Publication-ready styles and scientific colormaps
  • Panel helpers for multi-figure layouts
  • Terminal (ASCII) surface backend — render a lit brain as text, with data overlays

Terminal (ASCII) rendering

Render a cortical surface straight to text — no matplotlib figure — as a lit "surface of letters", with optional scalar overlays and parcellations in colour. The default is the folded pial cortex, and the output adapts to wherever it is drawn: terminal (ANSI colour), notebook/website (color_mode="html", auto-selected in a notebook), or README/plain-text (color_mode="none").

import bsplot

bsplot.plot_surf_ascii()                       # pial template brain, lateral
bsplot.plot_surf_ascii(data=my_stat_map)       # scalar overlay, colour-mapped
bsplot.plot_surf_ascii(parcellation=labels)    # coloured regions
bsplot.plot_surf_ascii(width=140)              # width = resolution knob
bsplot.plot_surf_ascii(background="light")     # for a white background
bsplot-ascii                          # pial fsaverage, lateral (or: python -m bsplot.ascii)
bsplot-ascii --view top --hemi both   # both hemispheres, dorsal
bsplot-ascii --html > brain.html      # emit an HTML block
bsplot-ascii --sphere                 # offline demo (no download)

See the Terminal surface guide for ramps, colormaps, views, and resolution.

Timeseries — recordings and simulations

Surface colouring over time, cheap enough to stream live. The geometry is prepared once, so each frame only re-colours the visible faces: ~0.7 ms/frame (>1000 fps) against ~184 ms for a full render.

mov = bsplot.AsciiSurfaceMovie(data, hemi="lh", view="lateral", width=80)
mov.play(fps=20)                    # live in the terminal
mov.to_gif("sim.gif"); mov.to_html("sim.html"); mov.to_cast("sim.cast")

# region-level data (TVB-style) mapped onto the surface by an atlas
bsplot.AsciiSurfaceMovie(data, atlas="DesikanKilliany", region_labels=labels)

# straight from a tvbo simulation result
bsplot.AsciiSurfaceMovie.from_tvbo("exp-3_result.h5", atlas="dk").play()
bsplot-ascii-movie data.npy --atlas Destrieux --fps 20     # play
bsplot-ascii-movie result.h5 --tvbo -o sim.gif             # or export

See the Timeseries guide. Reading tvbo result files needs pip install "bsplot[tvbo]".

alt text

Installation

pip install bsplot

Dependencies

  • matplotlib
  • nibabel
  • nilearn
  • templateflow
  • scikit-image

Download files

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

Source Distribution

bsplot-0.0.10.tar.gz (6.2 MB view details)

Uploaded Source

Built Distribution

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

bsplot-0.0.10-py3-none-any.whl (6.2 MB view details)

Uploaded Python 3

File details

Details for the file bsplot-0.0.10.tar.gz.

File metadata

  • Download URL: bsplot-0.0.10.tar.gz
  • Upload date:
  • Size: 6.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for bsplot-0.0.10.tar.gz
Algorithm Hash digest
SHA256 6ad5509dabb5ca65edb4b4775a6b5a2f1f37fe2de579e043d312a86665963108
MD5 680dddd4fda8f7e5bc3433662570a70c
BLAKE2b-256 d53fd8b95c82d28613d0562c2783a786f358ed91d5e5983db0fb32f81bf214bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for bsplot-0.0.10.tar.gz:

Publisher: publish-pypi.yml on virtual-twin/bsplot

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

File details

Details for the file bsplot-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: bsplot-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 6.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for bsplot-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 20354268afffc44f437a0b0dec91a4fe990dca48c1b435e8b525c261e2f40c31
MD5 d38eb8af60391401e1c1c88f057aea69
BLAKE2b-256 8071f587178143f432a38895b4c1d264ab0a07150975027a1289bbfcfce4968e

See more details on using hashes here.

Provenance

The following attestation bundles were made for bsplot-0.0.10-py3-none-any.whl:

Publisher: publish-pypi.yml on virtual-twin/bsplot

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

Release history Release notifications | RSS feed

0.0.11

2 files

This release

0.0.10 This release

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.4

1 file

0.0.3

1 file

0.0.2

1 file

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