Examples#
NAVis is a Python library for exploring and analyzing neurons. Load them from local files or remote databases, work with them as skeletons, meshes, dotprops or voxels, and plot, process and compare them — often in just a few lines.
import navis
# a bundled example neuron (mesh)
m = navis.example_neurons(1, kind="mesh")
# interactive 3D — spin, zoom, hover
navis.plot3d(m, color="coral")
import navis
# start from a mesh
m = navis.example_neurons(1, kind="mesh")
# convert it into the other neuron types
sk = navis.skeletonize(m) # TreeNeuron
vx = navis.voxelize(m, pitch="1 micron") # VoxelNeuron
dp = navis.make_dotprops(m, k=5) # Dotprops

import navis
n = navis.example_neurons(1, kind="skeleton")
# split into axon, dendrite & linker by synapse flow
split = navis.split_axon_dendrite(n)
navis.plot2d(split, color_by="compartment")

import navis
import navis.interfaces.neuprint as neu
# connect to a neuPrint dataset
client = neu.Client("https://neuprint.janelia.org", dataset="male-cns:v1.0")
# fetch all right antennal-lobe projection neurons
sk = neu.fetch_skeletons(neu.NeuronCriteria(class_="ALPN", somaSide="R"))
# cluster them by NBLAST morphological similarity
dp = navis.make_dotprops(sk, k=5)
scores = navis.nblast_allbyall(dp.convert_units("um"))
