bsplot
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]".
Installation
pip install bsplot
Two optional features — volume-to-surface projection (project_vol_to_surf)
and fsaverage cortical flatmaps (get_flat_surface_geometry) — additionally
need nilearn:
pip install "bsplot[projection]"
Dependencies
matplotlibnibabelscipytemplateflowscikit-imagenilearn— optional, only forproject_vol_to_surfand cortical flatmaps (pip install "bsplot[projection]")
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bsplot-0.0.11.tar.gz.
File metadata
- Download URL: bsplot-0.0.11.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62eb9cb053db380440d7b420989497c081b4c8dc98abf9cbc6718668f594c11d
|
|
| MD5 |
ae0e2ae6df9ea801774b17535c7353a3
|
|
| BLAKE2b-256 |
ddd03658cec3764756323318e4133711b10406301d6366cbbdb1618e329ef0a8
|
Provenance
The following attestation bundles were made for bsplot-0.0.11.tar.gz:
Publisher:
publish-pypi.yml on virtual-twin/bsplot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bsplot-0.0.11.tar.gz -
Subject digest:
62eb9cb053db380440d7b420989497c081b4c8dc98abf9cbc6718668f594c11d - Sigstore transparency entry: 2236081505
- Sigstore integration time:
-
Permalink:
virtual-twin/bsplot@a3e630ba4791a6bd1162fd9236012e0490caeef6 -
Branch / Tag:
refs/tags/v0.0.11 - Owner: https://github.com/virtual-twin
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@a3e630ba4791a6bd1162fd9236012e0490caeef6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file bsplot-0.0.11-py3-none-any.whl.
File metadata
- Download URL: bsplot-0.0.11-py3-none-any.whl
- Upload date:
- Size: 6.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
416ef408d7c1e501575ba529f2a7ad6a8dac0324f591d4c480e4099657572859
|
|
| MD5 |
d02eeea963ce1271aad607bdd5709b45
|
|
| BLAKE2b-256 |
f247fe352cf9f914d388e9244fa9c1d3884a48667582690787d9ab5a3db42f68
|
Provenance
The following attestation bundles were made for bsplot-0.0.11-py3-none-any.whl:
Publisher:
publish-pypi.yml on virtual-twin/bsplot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bsplot-0.0.11-py3-none-any.whl -
Subject digest:
416ef408d7c1e501575ba529f2a7ad6a8dac0324f591d4c480e4099657572859 - Sigstore transparency entry: 2236081573
- Sigstore integration time:
-
Permalink:
virtual-twin/bsplot@a3e630ba4791a6bd1162fd9236012e0490caeef6 -
Branch / Tag:
refs/tags/v0.0.11 - Owner: https://github.com/virtual-twin
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@a3e630ba4791a6bd1162fd9236012e0490caeef6 -
Trigger Event:
release
-
Statement type: