API Reference

navis has grown a lot! Last I looked, there were ~110 functions exposed at top level (e.g. navis.plot3d) and easily another 100 secondary functions available via submodules (e.g. navis.morpho.find_soma). This can be a bit daunting at first - especially if you don’t exactly know what you are looking for. I recommend you either just have a browse, use the search field (upper right) or simply search in page (CONTROL/CMD-F). Failing that, please feel free to open an issue on the Github repo with your question.

This API reference is a more or less complete account of the primary functions:

  1. Neuron- and NeuronList functions and methods

  2. Functions for visualization

  3. Manipulate or analyze neuron morphology

  4. Transforming and mirroring data

  5. Analyze connectivity

  6. Import/Export

  7. Utility functions

  8. Which functions work with which neuron types?

In addition navis has interfaces to various external datasets and tools:

Most of these functions include examples of how to use them. Click on them to learn more!

Neuron/List

TreeNeurons, MeshNeurons, VoxelNeurons and Dotprops are neuron classes. NeuronLists are containers thereof.

navis.BaseNeuron(**kwargs)

Base class for all neurons.

navis.TreeNeuron(x[, units])

Neuron represented as hierarchical tree (i.e.

navis.MeshNeuron(x[, units, process, validate])

Neuron represented as mesh with vertices and faces.

navis.VoxelNeuron(x[, offset, cache, units])

Neuron represented as voxels.

navis.Dotprops(points, k[, vect, alpha, units])

Neuron represented as points + local vectors.

navis.NeuronList(x[, make_copy, make_using, ...])

Collection of neurons.

General Neuron methods

Despite being fundamentally different data types, all neurons share some common methods (i.e. functions) which they inherit from their (abstract) parent class BaseNeurons.

copy()

Return a copy of the neuron.

plot3d(**kwargs)

Plot neuron using navis.plot3d().

plot2d(**kwargs)

Plot neuron using navis.plot2d().

summary([add_props])

Get a summary of this neuron.

convert_units(to[, inplace])

Convert coordinates to different unit.

map_units(units[, on_error])

Convert units to match neuron space.

memory_usage([deep, estimate])

Return estimated memory usage of this neuron.

In addition to methods, neurons also have properties. These properties common to all neurons:

connectors

Connector table.

postsynapses

Table with postsynapses.

presynapses

Table with presynapses.

datatables

Names of all DataFrames attached to this neuron.

id

Hashable ID.

name

Neuron name.

units

Unit space for this neuron.

type

Neuron type.

TreeNeurons

These are class methods available specific for TreeNeurons. Most of them are simply short-hands for the other navis functions:

convert_units(to[, inplace])

Convert coordinates to different unit.

cell_body_fiber([reroot_soma, inplace])

Prune neuron to its cell body fiber.

downsample([factor, inplace])

Downsample the neuron by given factor.

get_graph_nx()

Calculate and return networkX representation of neuron.

get_igraph()

Calculate and return iGraph representation of neuron.

prune_by_longest_neurite([n, reroot_soma, ...])

Prune neuron down to the longest neurite.

prune_by_strahler(to_prune[, inplace])

Prune neuron based on Strahler order.

prune_by_volume(v[, mode, ...])

Prune neuron by intersection with given volume(s).

prune_distal_to(node[, inplace])

Cut off nodes distal to given nodes.

prune_proximal_to(node[, inplace])

Remove nodes proximal to given node.

prune_twigs(size[, inplace, recursive])

Prune terminal twigs under a given size.

reload([inplace])

Reload neuron.

reroot(new_root[, inplace])

Reroot neuron to given node ID or node tag.

resample(resample_to[, inplace])

Resample neuron to given resolution.

snap(locs[, to])

Snap xyz location(s) to closest node or synapse.

In addition TreeNeurons have a range of different properties:

cable_length

Cable length.

cycles

Cycles in neuron if any.

downsample([factor, inplace])

Downsample the neuron by given factor.

igraph

iGraph representation of this neuron.

is_tree

Whether neuron is a tree.

n_branches

Number of branch points.

n_leafs

n_skeletons

Return number of seperate skeletons in this neuron.

n_trees

Count number of connected trees in this neuron.

nodes

Node table.

root

Root node(s).

sampling_resolution

Average cable length between 2 nodes.

segments

Neuron broken down into linear segments.

simple

Return simple neuron representation.

soma_pos

Search for soma and return its position.

subtrees

List of subtrees.

volume

Radius-based volume.

MeshNeurons

These are methods and properties specific to MeshNeurons.

faces

Faces making up the neuron.

vertices

Vertices making up the neuron.

skeletonize([method, heal, inv_dist])

Skeletonize mesh.

snap(locs[, to])

Snap xyz location(s) to closest vertex or synapse.

trimesh

Trimesh representation of the neuron.

volume

Volume of the neuron.

validate([inplace])

Use trimesh to try and fix some common mesh issues.

navis

grid

Voxel grid representation.

voxels

(N, 3) array of x/y/z voxels locations

shape

Shape of voxel grid.

strip([inplace])

Strip empty voxels (leading/trailing planes of zeros).

Dotprops

These are methods and properties specific to Dotprops.

points

Center of tangent vectors.

vect

Tangent vectors.

alpha

Alpha value for tangent vectors.

to_skeleton([scale_vec])

Turn dotprops into a skeleton.

snap(locs[, to])

Snap xyz location(s) to closest point or synapse.

Dotprops are typically indirectly generated from e.g. skeletons or point clouds using navis.make_dotprops().

Conversion

There are a couple functions to convert from one neuron type to another:

navis.make_dotprops(x[, k, resample, threshold])

Produce dotprops from x/y/z points.

navis.skeletonize(x, **kwargs)

Turn neuron into skeleton.

navis.mesh(x, **kwargs)

Generate mesh from object(s).

navis.voxelize(x, pitch[, bounds, counts, ...])

Turn neuron into voxels.

NeuronList methods

NeuronLists let you access all the properties and methods of the neurons they contain. In addition there are a few NeuronList-specific methods and properties.

Methods:

apply(func, *[, parallel, n_cores, ...])

Apply function across all neurons in this NeuronList.

head([N])

Return summary for top N neurons.

itertuples()

Helper to mimic pandas.DataFrame.itertuples().

mean()

Return mean numeric and boolean values over all neurons.

remove_duplicates([key, inplace])

Remove duplicate neurons from list.

sum()

Return sum numeric and boolean values over all neurons.

summary([N, add_props])

Get summary over all neurons in this NeuronList.

tail([N])

Return summary for bottom N neurons.

unmix()

Split into NeuronLists of the same neuron type.

Properties:

bbox

Bounding box across all neurons in the list.

empty

Return True if NeuronList is empty.

is_degenerated

Return True if contains neurons with non-unique IDs.

is_mixed

Return True if contains more than one type of neuron.

shape

Shape of NeuronList (N, ).

types

Return neuron types present in this list.

Visualization

Various functions for plotting neurons and volumes.

navis.plot3d(x, **kwargs)

Generate 3D plot.

navis.plot2d(x[, method])

Generate 2D plots of neurons and neuropils.

navis.plot1d(x[, ax, color])

Plot neuron topology in 1D according to Cuntz et al. (2010).

navis.plot_flat(x[, layout, connectors, ...])

Plot neuron as flat diagrams.

navis.clear3d()

Clear viewer 3D canvas.

navis.close3d()

Close existing vispy 3D canvas (wipes memory).

navis.get_viewer()

Grab active 3D viewer.

navis.screenshot([file, alpha])

Save a screenshot of active vispy 3D canvas.

Plotting Volumes/Meshes

To plot meshes, you can pass trimesh.Trimesh objects directly to plot3d or plot2d. However, navis has a custom class to represent meshes that has some useful perks: navis.Volume.

navis.Volume(vertices[, faces, name, color, id])

Mesh consisting of vertices and faces.

navis.Volume.combine(x[, name, color])

Merge multiple volumes into a single object.

navis.Volume.plot3d(**kwargs)

Plot volume using navis.plot3d().

navis.Volume.validate()

Use trimesh to try and fix issues (holes/normals).

navis.Volume.resize(x[, method, inplace])

Resize volume.

Vispy 3D viewer

Using navis.plot3d() from a terminal will spawn a Vispy 3D viewer object which has a bunch of useful methods:

navis.Viewer([picking])

Vispy 3D viewer.

navis.Viewer.add(x[, center, clear, combine])

Add objects to canvas.

navis.Viewer.clear()

Clear canvas.

navis.Viewer.close()

Close viewer.

navis.Viewer.colorize([palette, ...])

Colorize neurons using a seaborn color palette.

navis.Viewer.set_colors(c[, include_connectors])

Set neuron color.

navis.Viewer.hide_neurons(n)

Hide given neuron(s).

navis.Viewer.unhide_neurons([n, check_alpha])

Unhide given neuron(s).

navis.Viewer.screenshot([filename, ...])

Save a screenshot of this viewer.

navis.Viewer.show()

Show viewer.

navis.Viewer.toggle_bounds()

Toggle bounding box.

Neuron Morphology

Collection of functions to analyze and manipulate neuronal morphology.

Manipulation

Functions to edit morphology:

navis.average_skeletons(x[, limit, base_neuron])

Compute an average from a list of skeletons.

navis.break_fragments(x[, labels_only, min_size])

Break neuron into its connected components.

navis.despike_skeleton(x[, sigma, ...])

Remove spikes in skeleton (e.g.

navis.drop_fluff(x[, keep_size, inplace])

Remove small disconnected pieces of "fluff".

navis.cell_body_fiber(x[, reroot_soma, ...])

Prune neuron to its cell body fiber.

navis.cut_skeleton(x, where[, ret])

Split skeleton at given point and returns two new neurons.

navis.guess_radius(x[, method, limit, ...])

Guess radii for skeleton nodes.

navis.heal_skeleton(x[, method, max_dist, ...])

Heal fragmented skeleton(s).

navis.longest_neurite(x[, n, reroot_soma, ...])

Return a neuron consisting of only the longest neurite(s).

navis.prune_by_strahler(x, to_prune[, ...])

Prune neuron based on Strahler order.

navis.prune_twigs(x, size[, exact, inplace, ...])

Prune terminal twigs under a given size.

navis.prune_at_depth(x, depth, *[, source, ...])

Prune all neurites past a given distance from a source.

navis.reroot_skeleton(x, new_root[, inplace])

Reroot neuron to new root.

navis.split_axon_dendrite(x[, metric, ...])

Split a neuron into axon and dendrite.

navis.split_into_fragments(x[, n, min_size, ...])

Split neuron into fragments.

navis.stitch_skeletons(*x[, method, master, ...])

Stitch multiple skeletons together.

navis.subset_neuron(x, subset[, inplace, ...])

Subset a neuron to a given set of nodes/vertices.

navis.smooth_skeleton(x[, window, ...])

Smooth skeleton(s) using rolling windows.

navis.smooth_mesh(x[, iterations, L, ...])

Smooth meshes (TriMesh, MeshNeuron, Volume).

navis.smooth_voxels(x[, sigma, inplace])

Smooth voxel(s) using a Gaussian filter.

navis.tortuosity(x[, seg_length])

Calculate tortuosity of a neuron.

Resampling

Functions to down- or resample neurons.

navis.resample_skeleton(x, resample_to[, ...])

Resample skeleton(s) to given resolution.

navis.resample_along_axis(x, interval[, ...])

Resample neuron such that nodes lie exactly on given 1d grid.

navis.downsample_neuron(x, downsampling_factor)

Downsample neuron(s) by a given factor.

navis.simplify_mesh(x, F[, backend, inplace])

Simplify meshes (TriMesh, MeshNeuron, Volume).

Analysis

Functions to analyze morphology.

navis.find_main_branchpoint(x[, reroot_soma])

Return the branch point at which the two largest branches converge.

navis.strahler_index(x[, method, to_ignore, ...])

Calculate Strahler Index (SI).

navis.nblast(query[, target, scores, ...])

NBLAST query against target neurons.

navis.nblast_smart(query[, target, t, ...])

Smart(er) NBLAST query against target neurons.

navis.nblast_allbyall(x[, normalized, ...])

All-by-all NBLAST of inputs neurons.

navis.synblast(query, target[, by_type, ...])

Synapsed-based variant of NBLAST.

Polarity metrics

navis.bending_flow(x)

Calculate bending flow.

navis.flow_centrality(x[, mode])

Calculate synapse flow centrality (SFC).

navis.arbor_segregation_index(x)

Per arbor seggregation index (SI).

navis.segregation_index(x)

Calculate segregation index (SI).

Distances

Functions to calculate Euclidian and geodesic (“along-the-arbor”) distances.

navis.cable_overlap(a, b[, dist, method])

Calculate the amount of cable of neuron A within distance of neuron B.

navis.distal_to(x[, a, b])

Check if nodes A are distal to nodes B.

navis.dist_between(x, a, b)

Get the geodesic distance between nodes in nanometers.

navis.geodesic_matrix(x[, from_, directed, ...])

Generate geodesic ("along-the-arbor") distance matrix between nodes/vertices.

navis.segment_length(x, segment)

Get length of a linear segment.

Intersection

Functions to intersect points and neurons with volumes.

navis.in_volume(x, volume[, mode, backend, ...])

Test if points/neurons are within a given volume.

navis.intersection_matrix(x, volumes[, attr])

Compute intersection matrix between a set of neurons and volumes.

Transforming and Mirroring

Functions to transform spatial data between (e.g. neurons) template brains. Check out the tutorials for example on how to use them.

High-level functions:

navis.xform(x, transform[, affine_fallback, ...])

Apply transform(s) to data.

navis.xform_brain(x, source, target[, ...])

Transform 3D data between template brains.

navis.symmetrize_brain(x, template[, via, ...])

Symmetrize 3D object (neuron, coordinates).

navis.mirror_brain(x, template[, ...])

Mirror 3D object (neuron, coordinates) about given axis.

navis.transforms.mirror(points, mirror_axis_size)

Mirror 3D coordinates about given axis.

navis supports several types of transforms:

AffineTransform(matrix[, direction])

Affine transformation of 3D spatial data.

ElastixTransform(file[, copy_files])

Elastix transforms of 3D spatial data.

CMTKtransform(regs[, directions, threads])

CMTK transforms of 3D spatial data.

H5transform(f[, direction, level, cache, ...])

Hdf5 transform of 3D spatial data.

TPStransform(landmarks_source, landmarks_target)

Thin Plate Spline transforms of 3D spatial data.

AliasTransform()

Helper transform that simply passes points through.

MovingLeastSquaresTransform(...[, direction])

Moving Least Squares transforms of 3D spatial data.

The TemplateRegistry keeps track of template brains, transforms and such:

TemplateRegistry([scan_paths])

Tracks template brains, available transforms and produces bridging sequences.

This relevant instance of this class is navis.transforms.registry. So to register a new transform you would for example do this:

>>> navis.transforms.registry.register_transform(transform, ...)

These are the methods and properties of registry:

register_transform(transform, source, ...[, ...])

Register a transform.

register_transformfile(path, **kwargs)

Parse and register a transform file.

register_templatebrain(template[, skip_existing])

Register a template brain.

register_path(paths[, trigger_scan])

Register path(s) to scan for transforms.

scan_paths([extra_paths])

Scan registered paths for transforms and add to registry.

plot_bridging_graph(**kwargs)

Draw bridging graph using networkX.

find_mirror_reg(template[, non_found])

Search for a mirror transformation for given template.

find_bridging_path(source, target[, reciprocal])

Find bridging path from source to target.

shortest_bridging_seq(source, target[, via, ...])

Find shortest bridging sequence to get from source to target.

clear_caches()

Clear caches of all cached functions.

summary()

Generate summary of available transforms.

transforms

Registered transforms (bridging + mirror).

mirrors

Registered mirror transforms.

bridges

Registered bridging transforms.

Connectivity

Collection of functions to work with graphs and adjacency matrices.

Graphs

Functions to convert neurons and networkx to iGraph or networkX graphs.

navis.neuron2nx(x)

Turn Tree-, Mesh- or VoxelNeuron into an NetworkX graph.

navis.neuron2igraph(x[, connectivity, ...])

Turn Tree-, Mesh- or VoxelNeuron(s) into an iGraph graph.

navis.neuron2KDTree(x[, tree_type, data])

Turn neuron into scipy KDTree.

navis.network2nx(x[, threshold, group_by])

Generate NetworkX graph from edge list or adjacency.

navis.network2igraph(x[, threshold])

Generate iGraph graph from edge list or adjacency.

navis.rewire_skeleton(x, g[, root, inplace])

Rewire neuron from graph.

navis.insert_nodes(x, where[, coords, ...])

Insert new nodes between existing nodes.

navis.remove_nodes(x, which[, inplace])

Drop nodes from neuron without disconnecting it.

Connectivity metrics

Functions to analyse/cluster neurons based on connectivity.

navis.connectivity_similarity(adjacency[, ...])

Calculate connectivity similarity.

navis.connectivity_sparseness(x[, which])

Calculate sparseness.

navis.cable_overlap(a, b[, dist, method])

Calculate the amount of cable of neuron A within distance of neuron B.

navis.synapse_similarity(x, sigma, omega[, ...])

Cluster neurons based on their synapse placement.

Import/Export

Functions to import/export neurons.

navis.read_swc(f[, connector_labels, ...])

Create Neuron/List from SWC file.

navis.write_swc(x, filepath[, header, ...])

Generate SWC file from neuron(s).

navis.read_nrrd(f[, threshold, ...])

Create Neuron/List from NRRD file.

navis.write_nrrd(f, neuron[, attrs])

navis.read_nmx(f[, parallel, precision, ...])

Read NMX files into Neuron/Lists.

navis.read_rda(f[, combine, neurons_only])

Read objects from nat R data (.rda) file.

navis.read_json(s, **kwargs)

Load neuron from JSON (file or string).

navis.write_json(x, filepath, **kwargs)

Save neuron(s) to json-formatted file.

navis.write_precomputed(x[, filepath, ...])

Export skeletons or meshes to neuroglancers' (legacy) precomputed format.

navis.read_precomputed(f[, datatype, ...])

Read skeletons and meshes from neuroglancer's precomputed format.

Interfaces

Interfaces with various external tools/websites. These modules have to be imported explicitly as they are not imported at top level.

NEURON simulator

Functions to facilitate creating compartment models of neurons. Please see the tutorials for details.

Not imported at top level! Must be imported explicitly:

import navis.interfaces.neuron as nrn

NeuroMorpho API

Set of functions to grab data from NeuroMorpho which hosts thousands of neurons (see tutorials).

Not imported at top level! Must be imported explicitly:

from navis.interfaces import neuromorpho

navis.interfaces.neuromorpho.get_neuron_info(x)

Fetch neuron info by ID or by name.

navis.interfaces.neuromorpho.get_neuron(x, ...)

Fetch neuron by ID or by name.

navis.interfaces.neuromorpho.get_neuron_fields()

List all available neuron fields.

navis.interfaces.neuromorpho.get_available_field_values(field)

List all possible values for given neuron field.

neuPrint API

NAVis wraps neuprint-python and adds a few navis-specific functions. You must have neuprint-python installed for this to work:

pip install neuprint-python

You can then import neuprint from navis like so:

import navis.interfaces.neuprint as neu

navis.interfaces.neuprint.fetch_roi(roi, *)

Fetch given ROI.

navis.interfaces.neuprint.fetch_skeletons(x, *)

Construct navis.TreeNeuron/List from neuprint neurons.

navis.interfaces.neuprint.fetch_mesh_neuron(x, *)

Fetch mesh neuron.

Please also check out the tutorials for examples of how to fetch and work with data from neuPrint.

InsectBrain DB API

Set of functions to grab data from InsectBrain which hosts some neurons and standard brains (see tutorials).

Not imported at top level! Must be imported explicitly:

from navis.interfaces import insectbrain_db

navis.interfaces.insectbrain_db.authenticate([...])

Authenticate against Insect Brain DB.

navis.interfaces.insectbrain_db.get_brain_meshes(species)

Fetch brain meshes for given species.

navis.interfaces.insectbrain_db.get_species_info(species)

Get all info for given species.

navis.interfaces.insectbrain_db.get_available_species()

Get all info for given species.

navis.interfaces.insectbrain_db.get_skeletons(x)

Fetch skeletons for given neuron(s).

navis.interfaces.insectbrain_db.get_skeletons_species(species)

Fetch all skeletons for given species.

navis.interfaces.insectbrain_db.search_neurons([...])

Search for neurons matching given parameters.

Blender API

Functions to be run inside Blender 3D and import CATMAID data (see Examples). Please note that this requires Blender >2.8 as earlier versions are shipped with Python <3.6. See the tutorials for an introduction of how to use navis in Blender.

Not imported at top level! Must be imported explicitly:

from navis.interfaces import blender

The interface is realised through a Handler object. It is used to import objects and facilitate working with them programmatically once they are imported.

navis.interfaces.blender.Handler([scaling, ...])

Class that interfaces with scene in Blender.

Objects

navis.interfaces.blender.Handler.add(x[, ...])

Add neuron(s) to scene.

navis.interfaces.blender.Handler.clear()

Clear all neurons

navis.interfaces.blender.Handler.select(x, *args)

Select given neurons.

navis.interfaces.blender.Handler.hide()

Hide all neuron-related objects.

navis.interfaces.blender.Handler.unhide()

Unide all neuron-related objects.

Materials

navis.interfaces.blender.Handler.color(r, g, b)

Assign color to all neurons.

navis.interfaces.blender.Handler.colorize()

Randomly colorize ALL neurons.

navis.interfaces.blender.Handler.emit(v)

Change emit value.

navis.interfaces.blender.Handler.use_transparency(v)

Change transparency (True/False).

navis.interfaces.blender.Handler.alpha(v)

Change alpha (0-1).

navis.interfaces.blender.Handler.bevel(r)

Change bevel of ALL neurons.

Selections

navis.interfaces.blender.Handler.select(x, *args)

Select given neurons.

navis.interfaces.blender.ObjectList.select([...])

Select objects in 3D viewer

navis.interfaces.blender.ObjectList.color(r, g, b)

Assign color to all objects in the list.

navis.interfaces.blender.ObjectList.colorize()

Assign colors across the color spectrum.

navis.interfaces.blender.ObjectList.emit(e)

Change emit value.

navis.interfaces.blender.ObjectList.use_transparency(t)

Change transparency (True/False).

navis.interfaces.blender.ObjectList.alpha(a)

Change alpha (0-1).

navis.interfaces.blender.ObjectList.bevel(r)

Change bevel radius of objects.

navis.interfaces.blender.ObjectList.hide()

Hide objects.

navis.interfaces.blender.ObjectList.unhide()

Unhide objects.

navis.interfaces.blender.ObjectList.hide_others()

Hide everything BUT these objects.

navis.interfaces.blender.ObjectList.delete()

Delete neurons in the selection.

Cytoscape API

Functions to use Cytoscape via the cyREST API.

Not imported at top level! Must be imported explicitly:

from navis.interfaces import cytoscape

navis.interfaces.cytoscape.generate_network(x)

Load network into Cytoscape.

navis.interfaces.cytoscape.get_client()

Initialises connection with Cytoscape and returns client.

Allen MICrONS datasets

Functions to fetch neurons (including synapses) from the Allen Institute’s MICrONS EM datasets.

Requires caveclient as additional dependencies:

pip3 install caveclient -U

Please see caveclient's docs for details on how to retrieve and set credentials.

Not imported at top level! Must be imported explicitly:

from navis.interfaces import microns

Please also see the MICrONS tutorial.

R interface

Bundle of functions to use R natverse libraries.

Not imported at top level! Must be imported explicitly:

from navis.interfaces import r

navis.interfaces.r.data2py(data, **kwargs)

Convert data from rcatmaid (e.g.

navis.interfaces.r.get_neuropil(x[, template])

Fetch given neuropil from nat.flybrains, flycircuit or elmr.

navis.interfaces.r.init_rcatmaid(**kwargs)

Initialize the R Catmaid package.

navis.interfaces.r.load_rda(fp[, convert])

Load and convert R data file (.rda).

navis.interfaces.r.nblast(query[, target, ...])

NBLAST using R's nat.nblast::nblast.

navis.interfaces.r.nblast_allbyall(x[, ...])

All-by-all NBLAST using R's nat.nblast::nblast_allbyall.

navis.interfaces.r.NBLASTresults(results, ...)

Class holding NBLAST results and wrappers that allow easy plotting.

navis.interfaces.r.neuron2py(x)

Convert R neuron objects (dotprops, neurons, etc) to navis Neuron/Lists.

navis.interfaces.r.neuron2r(x[, ...])

Convert Neuron/List to corresponding R neuron/neuronlist object.

navis.interfaces.r.xform_brain(x, source, target)

Transform 3D data between template brains.

navis.interfaces.r.mirror_brain(x, template)

Mirror 3D object along given axixs.

Utility

Various utility functions.

navis.health_check(x[, verbose])

Run a health check on TreeNeurons and flag potential issues.

navis.set_pbars([hide, leave, jupyter])

Set global progress bar behaviors.

navis.set_loggers([level])

Set levels for all associated module loggers.

navis.set_default_connector_colors(x)

Set/update default connector colors.

navis.config.remove_log_handlers()

Remove all handlers from the navis logger.

navis.patch_cloudvolume()

Monkey patch cloud-volume to return navis neurons.

Neuron types and functions

As you can imagine not all functions will work on all neuron types. For example it is currently not possible to find the longest neurite (navis.longest_neurite()) in a VoxelNeuron. Conversely, some functionality like “smoothing” makes sense for multiple neuron types but the application is so vastly different between e.g. meshes and skeletons that there is no single function but one for each neuron type.

Below table has an overview for which functions work with which neuron types.

Description

TreeNeuron

MeshNeuron

VoxelNeuron

Dotprops

navis.plot2d()

yes

yes

limited

yes

navis.plot3d()

yes

yes

limited

yes

navis.plot1d()

yes

no

no

no

navis.plot_flat()

yes

no

no

no

navis.subset_neuron()

yes

yes

yes

yes

navis.in_volume()

yes

yes

yes

yes

smoothing

navis.smooth_skeleton()

navis.smooth_mesh()

navis.smooth_voxels()

no

navis.downsample_neuron()

yes

yes

yes

yes

resampling (e.g. navis.resample_skeleton())

yes

no

no

no

NBLAST (e.g. navis.nblast())

no

no

no

yes

navis.xform_brain()

yes

yes

yes

yes

navis.mirror_brain()

yes

yes

no

yes

navis.skeletonize()

no

yes

no

no

navis.mesh()

yes

no

yes

no

navis.voxelize()

yes

yes

no

yes

navis.drop_fluff()

yes

yes

no

no

navis.break_fragments()

yes

yes

no

no