Skip to content

navis-fastcore (Python)

Python bindings for the fastcore Rust core, built with PyO3. Functions here are generalized and do not depend on navis itself, so third-party libraries can use them without that rather heavy dependency — navis-fastcore's only runtime requirement is numpy.

Install

Pre-compiled wheels are on PyPI:

pip install navis-fastcore

See the GitHub repo if you want to build from source.

Usage

navis will use fastcore automatically where appropriate — you only need this section if you want to call it directly.

Tree functions take node_ids and parent_ids arrays; the mapping from arbitrary IDs onto the core's internal indices happens for you.

import navis_fastcore as fastcore
import numpy as np

node_ids = np.array([1, 2, 3, 4, 5])
parent_ids = np.array([-1, 1, 2, 3, 1])  # -1 marks the root

# All-by-all geodesic distances
dists = fastcore.geodesic_matrix(node_ids, parent_ids)

Available functions

Operations on rooted trees:

Repairing fragmented skeletons:

Meshes:

Neuron similarity:

Interop: