Skip to content

NAVis & Friends#

NAVis comes with batteries included but is also highly extensible. Here are some libraries that are built directly on top of NAVis.

NAVis ecosystem

flybrains#

flybrains is a package that bundles fly template brains and transforms that NAVis can use to map spatial data (e.g. neurons) from one brain space to another. If you installed NAVis via pip with the [flybrains] option, you should already have this package.

import navis
import flybrains  # importing registers the transforms with NAVis

# Plot one of the template brains
navis.plot2d(flybrains.JRC2018U)

# Transform neurons to another brain space
n = navis.example_neurons(3, kind='skeleton')
xf = navis.xform_brain(n, source='JRCFIB2018F', target='JRC2018F')

pymaid#

pymaid provides an interface with CATMAID servers. It allows you to pull data (neurons, connectivity) that can be directly plugged into NAVis. Conversely, you can also take NAVis neurons and push them to a CATMAID server. pymaid is a great example of how to extend NAVis.

import navis
import pymaid

# Connect to a public CATMAID server
rm = pymaid.CatmaidInstance(server="https://fafb.catmaid.virtualflybrain.org/", api_token=None)

# Fetch some neurons
nl = pymaid.get_neurons('annotation:Paper: Engert et al 2022')

# CATMAID neurons can be directly used in all NAVis functions
navis.plot2d(nl, radius=False)

fafbseg#

fafbseg contains tools to work with autosegmented data for the FAFB (full adult fly brain) EM dataset. It brings together data from FlyWire, Google's segmentation of FAFB and synapse predictions by Buhmann et al. (2019).

from fafbseg import flywire

# Grab a neuron mesh by its ID
n = flywire.get_mesh_neuron(720575940613091290)

# Skeletonize using NAVis
s navis.skeletonize(n)

natverse#

The natverse is NAVis's equivalent in R. While we are aiming for feature parity, it can be useful to access natverse functions from Python. For this, NAVis offers some convenience functions using the R-Python interface rpy2. Check out the tutorial.