Skip to main content

Neuroviewer icon

Neuroviewer

A freeview-like neuroimaging viewer written in pure Python.
PySide6 interface, vedo/VTK rendering, nibabel reading. Native desktop app, no browser, no server.

PyPI Python versions Tests MIT license

Neuroviewer

-->

Install

pip install neuroviewer              # core viewer
pip install "neuroviewer[open3d]"    # + Open3D point-cloud tools

Then:

neuroviewer                          # empty window
neuroviewer T1.mgz aseg.mgz lh.pial  # open files at start
python -m neuroviewer                # same thing
neuroviewer --install-desktop        # Linux: add a menu entry with icon

Requirements: Python 3.9+, an OpenGL-capable display. On Linux, Qt 6.5+ needs libxcb-cursor0 (sudo apt install libxcb-cursor0). A self-contained Linux AppImage is attached to each GitHub release.

What it does

  • Files (left): folder tree filtered to neuroimaging files, plus a recursive search under the root folder (name filter such as aseg, *T1*.nii.gz; blank = everything). Double click opens a file.
  • Views (centre): one main view and three side views (layout 1+3, 2x2 or 1x1). Click a panel title, a toolbar button or Ctrl+1..4 to put 3D / sagittal / coronal / axial in the main position.
  • Layers (right): one entry per volume, top of the list drawn on top, with two tabs:
    • Display: colormap, LUT (label maps), window min/max, opacity, "transparent below min", "outline only" (label borders), frame (4D);
    • ROIs: every label present in the volume with its LUT colour, name and volume (see below).
  • 3D scene (right, second tab): volume rendering of the active layer and the list of 3D objects (surfaces, streamlines, ROI surfaces, isosurfaces, point clouds) with visibility, colour and opacity.
  • Time course (bottom): signal of the active 4D layer at the cursor; the panel opens by itself when a 4D layer is selected.
  • Status bar: cursor in RAS mm, voxel index and value of every visible layer (with the LUT name for label maps).

Menus

menu contents
File Open, load surfaces / tracts, Load LUT, save screenshot, quit
View layout, main view (Ctrl+1..4), reset views, go to RAS, Clean 3D view (Ctrl+K: objects only, no slices / box / cursor), panels
Preferences Appearance (dark / light), Viewer options (2D crosshair, orientation letters, slice number; 3D slices, bounding box, cursor), Slice interpolation (nearest = voxels, linear / cubic = de-voxelised), 3D surfaces (smoothing / inflate), reset
Tools isosurface, label surfaces as separate objects, point clouds, Open3D tools
Help mouse and keys, about

Preferences are remembered per user (QSettings) and survive upgrades; config.py only provides the first-run defaults.

ROIs: choose which labels are shown

The ROIs tab lists the labels present in the active label map. Whatever is unchecked disappears from the 2D views, the 3D slices, the volume rendering and the ROI surfaces.

  • Click the check boxes, or select rows (drag over them, Shift/Ctrl click) and press Space (or Show selected / Hide selected).
  • The filter box narrows the list by name or ID ("hippo", "17"); All, None and Invert act on the rows currently listed. A typical sequence: None, then type hippocampus in the filter and press All.
  • By ID: 17 53 or ranges such as 1000-1035, then Show only, Add or Hide. Copy set / Paste set carry the shown IDs to another volume (e.g. the same hippocampal labels in several hippoAmygLabels files); the set also goes to the clipboard as text.
  • Double click a ROI to move the cursor to its centre.
  • Render shown ROIs as 3D surfaces builds organic surfaces of the shown labels in the 3D view. Combine with Clean 3D view to see only them.

Organic surfaces (de-voxelise and inflate)

Label and threshold surfaces are extracted from the voxels and then smoothed with a windowed-sinc filter, which removes the voxel staircase while keeping volume and position (Smoothing: 0 = raw voxel faces, 1 = very smooth). Inflate rounds folds and corners with Laplacian iterations and rescales about the centroid, so the shape balloons instead of shrinking. Both live in Preferences > 3D surfaces and apply to the ROI surfaces and to the surface tools. In 2D, Preferences > Slice interpolation

Linear / Cubic gives the de-voxelised look.

LUTs

Label maps start with FreeSurferColorLUT.txt (from $FREESURFER_HOME or FREESURFER_LUT_PATH). Any number of other tables can be loaded with File > Load LUT (or Load... next to the LUT box) and chosen per layer; loaded LUTs are reloaded at the next start. Supported formats:

  • FreeSurfer / 3D Slicer colour tables (idx name R G B A);
  • ITK-SNAP label descriptions (idx R G B A VIS MSH "name");
  • CSV / TSV with a header (BIDS *_dseg.tsv, nilearn/Schaefer style): index, name and either r g b columns or a hex color column.

A LUT next to a volume with the same stem is used automatically (atlas.nii.gz + atlas.txt, sub-01_dseg.nii.gz + sub-01_dseg.tsv).

Mouse and keys

where action
2D left click / drag: move cursor; shift+left or middle drag: pan; right drag or wheel: zoom
2D Up / PageUp, Down / PageDown: next / previous slice; r: fit slice
3D left drag: rotate; middle: pan; right / wheel: zoom; double click on a slice or surface: move cursor; r: reset camera

Formats

  • Volumes: .nii, .nii.gz, .mgz, .mgh, Analyze .img/.hdr, MINC .mnc, PAR/REC.
  • Surfaces: FreeSurfer lh.pial, rh.white, ... (shifted to scanner RAS with c_ras) and GIfTI .surf.gii.
  • Streamlines: .trk, .tck (direction-coloured, subsampled to TRACT_MAX_STREAMLINES).

Coordinates

Everything is kept in world coordinates (scanner RAS, mm). Volumes are reoriented to RAS+ voxel order on load (FreeSurfer conformed .mgz is LIA on disk) and keep their full affine. The first loaded volume defines the display grid; every other layer is sampled onto it through its own affine, so layers with different resolutions or fields of view overlay correctly. Oblique volumes are resampled for display.

Label maps are detected by file name (aseg, aparc, ribbon, ...) or by a sidecar LUT, plus integer values. Any layer can be shown as labels by setting its colormap to lut.

Configuration

The packaged defaults live in neuroviewer/config.py. Do not edit that copy; create your own once and edit it:

neuroviewer --write-config   # writes ~/.config/neuroviewer/config.py (Linux/macOS)
neuroviewer --config-path    # shows where it is (%APPDATA%\neuroviewer on Windows)

It is plain Python with the same names (radiological convention, colours, layout, label hints, LUT sidecar suffixes, surface smoothing, point-cloud size, Open3D parameters, screenshot scale, ...). Choices made in the Preferences menu override these defaults. Keep only the lines you change. Set NEUROVIEWER_CONFIG to use another file. An existing file is never overwritten unless you pass --force.

Tools (extension point)

neuroviewer/tools.py holds a registry. A tool is one function that receives a context (layers, active layer, cursor, grid, dialogs) and returns 3D objects:

from neuroviewer.tools import register_tool

@register_tool("My tool", "What it does.")
def my_tool(ctx):
    layer = ctx.require_active()
    arr, origin, spacing = ctx.aligned(layer)
    ...
    return [("result name", vedo_object, "mesh")]

Built-in tools: isosurface, label surfaces as separate objects (e.g. 17 53), cortex point cloud from FreeSurfer labels, threshold point cloud, point cloud from the last surface, Open3D voxel downsampling and Open3D Poisson reconstruction. Open3D is optional; it is used as a compute engine and the result is shown in vedo.

Troubleshooting

  • Could not find the Qt platform plugin "xcb": another Qt install is exporting its own plugin path (Spyder/PyQt5, opencv-python, conda qt). Neuroviewer resets it to the PySide6 plugins and prints the folder it used ([qt] ...). Start it from a terminal, not from the Spyder/IPython console. If it still fails, run QT_DEBUG_PLUGINS=1 neuroviewer.
  • Black views on Wayland: QT_QPA_PLATFORM=xcb neuroviewer.
  • Missing libxcb-cursor0 (Qt 6.5+ on Linux): install it with your package manager.

Development

git clone https://github.com/rdneuro/neuroviewer.git
cd neuroviewer
pip install -e ".[dev]"
pytest

See RELEASING.md for the PyPI and AppImage release steps.

License

MIT. See LICENSE. Neuroviewer depends on PySide6 (LGPLv3), VTK (BSD), vedo (MIT), nibabel (MIT) and matplotlib (PSF-based); the AppImage redistributes them under their own licenses.

Metadata

Release files for neuroviewer 0.2.0

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

Source distribution (sdist)

Source distribution for neuroviewer 0.2.0
File Size Uploaded Provenance Actions
neuroviewer-0.2.0.tar.gz 95.5 kB With provenance Details for neuroviewer-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 189.0 kB

Release files / neuroviewer-0.2.0.tar.gz

Download URL neuroviewer-0.2.0.tar.gz
Size 95.5 kB
Tags Source
SHA-256 checksum
How to use checksums
987ca06e21f57acd515ee1bedda385ceb8ef9a8a4aa9f9b49adce1929a211d28
BLAKE2b-256 checksum
How to use checksums
80d4c5b19e279f940509491bd566b70e479ad2ef82ac3965f9d7180670f55a85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 2, 2026.

Transparency log

Release files / neuroviewer-0.2.0-py3-none-any.whl

Download URL neuroviewer-0.2.0-py3-none-any.whl
Size 93.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60fa0f644dd4e9ca0c031092a6b55da628006635a36150d4f53d2fe00a9d5fdb
BLAKE2b-256 checksum
How to use checksums
8b2cc2b56cda33ee6ab98991fe59aa152a8eeef522ca226059e015f6ad52a9a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 2, 2026.

Transparency log

Security for neuroviewer 0.2.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for neuroviewer-0.2.0.tar.gz

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 Nov 2, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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