wbsurfer2
CLI tool for making CIFTI-related movies
https://github.com/user-attachments/assets/e40315fb-f528-4cc7-ae91-8827bfef242c
This is a refactor and refresh of the original wbsurfer tool. This version aims to support >= Connectome Workbench 2.0.
Setup
There are two ways to use wbsurfer2. The first and recommended way is to
download compiled binaries from the releases page.
Simply download the version meant for your OS and extract it.
If you are more comfortable with Python, you can also install wbsurfer2 from pip.
# install wbsurfer2 from PyPI
pip install wbsurfer2
# or if you want to install it for development
git clone git@github.com:vanandrew/wbsurfer2.git
cd wbsurfer2
pip install -e .
You will also need ffmpeg and wb_command installed on your system and on your PATH.
wb_command is part of the Connectome Workbench suite, which can be downloaded
here. The bin directory
contains the wb_command binary and should be added to your PATH.
# If you installed workbench in /opt/workbench
export PATH=$PATH:/opt/workbench/bin
# on macOS
export PATH=$PATH:/Applications/wb_view.app/Contents/usr/bin
ffmpeg can be downloaded in many ways, but I recommend using a package manager like apt or
brew:
# Ubuntu/Debian
sudo apt install ffmpeg
# macOS
brew install ffmpeg
Usage
Once it's installed, you can run the wb_surfer2 command. The following is the help message:
usage: wb_surfer2 [-h] [-v] -s SCENE_PATH -n SCENE_NAME [-o OUTPUT] [--width WIDTH] [--height HEIGHT] [-r FRAMERATE] [--closed | --reverse] [-l LOOPS]
[--print-vertices | --print-rows] [--num-cpus NUM_CPUS] [--vertex-mode | --border-file]
row_indices [row_indices ...]
Generate a movie from a list of row indices.
positional arguments:
row_indices The list of row indices to generate the movie from.
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-s SCENE_PATH, --scene-path SCENE_PATH
The scene file to use.
-n SCENE_NAME, --scene-name SCENE_NAME
The name of the scene in the scene file.
-o OUTPUT, --output OUTPUT
The output file path. Should end in .mp4.
--width WIDTH The width of the output movie. By default, 1920 pixels.
--height HEIGHT The height of the output movie. By default, 1080 pixels.
-r FRAMERATE, --framerate FRAMERATE
The framerate of the output movie. By default, 10 FPS.
--closed If enabled, a closed loop will be generated. This appends the first row index to the end of the row index traversal list. Mutually exclusive
with --reverse.
--reverse If enabled, a reverse of the traversal list will be appended to the row index traversal list. Mutually exclusive with --closed.
-l LOOPS, --loops LOOPS
How many times to loop the movie. By default, 1 loop.
--print-vertices If enabled, the vertex indices will be printed to the console, instead of outputting a movie.
--print-rows If enabled, the row indices will be printed to the console, instead of outputting a movie.
--num-cpus NUM_CPUS The number of CPUs to use for processing.
--vertex-mode If enabled, row_indices are treated as vertex indices. The first argument should be the surface that the vertices are on. Mutually exclusive
with --border-file (e.g. CORTEX_LEFT 0 1 2 3...)
--border-file If enabled, the border file will be used to generate the movie. The row_indices argument should be the border file. Mutually exclusive with
--vertex-mode.
wb_surfer2 requires a scene file to generate the movie. This scene file can be created in Connectome Workbench's
wb_view tool.
Unlike in version 1 of wb_surfer, wb_surfer2 can handle multiple scenes being defined in a file (though only one
active scene can be used at a time). The active scene is set by using the --scene-name argument.
When making your scene, at least one vertex must be placed on the surface for wb_surfer2 to control. In the case of
multiple vertices, the first vertex that was placed will be manipulated.
Metadata
Release files for wbsurfer2 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wbsurfer2-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for wbsurfer2-0.3.0-py3-none-any.whl |
Release files / wbsurfer2-0.3.0-py3-none-any.whl
| Download URL | wbsurfer2-0.3.0-py3-none-any.whl |
|---|---|
| Size | 21.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d47fdd4f992a746be0da8dcabcf7f2b76880d64d4568e4d73953be6fd64259c1
|
|
BLAKE2b-256 checksum How to use checksums |
4bba6f29ba3d8db7517654f26ed07c94ea4fe3072814fc6ee1bcfb3ad7db5fea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 7, 2026.
Transparency logSecurity for wbsurfer2 0.3.0
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.
Full provenance
1 file in this release has been uploaded with provenance metadata.
Attestation for wbsurfer2-0.3.0-py3-none-any.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 7, 2026.
Transparency logA 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.