Navis Versions Save

Python library for analysis of neuroanatomical data.

v1.6.0

1 month ago

It has been a long time (7 months, to be precise) since the last release but we've not been idle!

Version 1.6.0 is chock-full with new features, improvements and fixes. Here are some of the highlights:

Breaking

  • with this release we've dropped support for Python 3.8 as per NEP 29
  • navis.write_swc no longer writes Dotprops

New Features

  • navis.read_parquet and navis.write_parquet let you read/write large set of skeletons or dotprops; note: these are experimental and the format specs might still change but feel free to take it for a spin
  • new navis.NeuronConnector class for creating connectivity graphs from groups of neurons with consistent connector IDs (e.g. from pymaid neurons)

Improvements

  • improved logic for splitting NBLASTs across multiple cores
  • i/o functions can now read directly from .tar or .tar.gz files (.zip was already supported)

Fixes

  • fixes to the neuPrint interface by @stuarteberg
  • plotting empty TreeNeurons no longer breaks things thanks to @floesche
  • reading large files (i.e. mostly meshes) directly from a URL should not break anymore

New Contributors

Full Changelog: https://navis.readthedocs.io/en/latest/source/whats_new.html Commit history: https://github.com/navis-org/navis/compare/v1.5.0...v1.6.0

v1.5.0

9 months ago

Changes:

  • BREAKING: dropped support for Python 3.7
  • new function: navis.pop3d() removes the most recently added object from the vispy 3d viewer
  • new experimental functions for (pairwise) alignment of neurons using the pycpd package: navis.nblast_align(), navis.align.align_deform(), navis.align.align_rigid(), navis.align.align_pca(), navis.align.align_pairwise()
  • navis.xform_brain() now recognizes the target template’s units if available
  • new NeuronList method: navis.NeuronList.set_neuron_attributes()
  • new utility functions: navis.nbl.compress_scores(), navis.nbl.nblast_prime()
  • improved persistence functions: navis.persistence_distances(), navis.persistence_vector(), navis.persistence_diagram()
  • navis.longest_neurite() and navis.cell_body_fiber() now also allow removing the longest neurite and CBF, respectively
  • navis.heal_skeleton() now accepts a mask parameter that allows restricting where fragments are stitched
  • various other bugfixes

v1.4.0

1 year ago

This is release contains various improvements and fixes. Importantly, it fixes a couple incompatibilities with numpy 1.24.0.

Even though this is not a new major version there is one breaking change:

navis.flow_centrality was renamed to navis.synapse_flow_centrality and a new non-synaptic navis.flow_centrality function was added. This also impacts the method parameter in navis.split_axon_dendrite!

Please see the change log for other changes.

v1.3.1

1 year ago

This is a small release containing 2 fixes:

  1. Fixes a bug with the most recent version of dill which impact parallel processing.
  2. In Jupyter, NBLAST now uses classic progress bars. This is not ideal and all progress bars are printed on top of another but the widgets seem to be entirely broken with the most recent version of tqdm.

v1.3.0

2 years ago
  • as of this version pip install navis won't install a vispy backend (see install instructions for details)
  • new interface to fetch data from Virtual Fly Brain: navis.interfaces.vfb
  • tools to build custom NBLAST score matrices (big thanks to @clbarnes): see the new tutorial
  • Bayesian implementation of the network traversal model: navis.models.network_models.BayesianTraversalModel (big thanks to @aschampion)
  • NBLASTs: new approx_nn parameter (sacrifices precision for speed)
  • example neurons now come with some meta data
  • new morphometrics functions: navis.segment_analysis &navis.form_factor
  • new function to write meshes: navis.write_mesh
  • lots of fixes and improvements in particular for i/o-related functions

v1.2.1

2 years ago

Small fix for split_axon_dendrite.

v1.2.0

2 years ago

What's new:

  • new function: navis.betweeness_centrality
  • new function: navis.combine_neurons to simply concatenate neurons
  • new set of persistence functions: navis.persistence_vectors, navis.persistence_points and navis.persistence_distances
  • improvements to various functions: e.g. navis.bending_flow, navis.flow_centrality, navis.split_axon_dendrite and navis.longest_neurite
  • navis.read_swc now accepts a limit parameter that enables reading on the the first N neurons (useful to sample large collections)
  • navis.write_nrrd and navis.read_nrrd can now be used to write/read Dotprops to/from NRRD files
  • navis.nblast (and variants) now accept a precision parameter that allows setting the datatype for the matrix (useful to keep memory usage low for large NBLASTs)
  • navis.simplify_mesh (and therefore navis.downsample_neuron with skeletons) now uses the pyfqmr if present (much faster!)
  • improved the interface to Neuromorpho
  • added a new interface with the Allen Cell Types Atlas (see navis.interfaces.allen_celltypes)
  • myriads of small and big bugfixes

Thanks to @clbarnes and @Robbie1977 for contributing various PRs!

v1.1.0

2 years ago

This is primarily a bug fix release for an issue when plotting skeletons with the newest plotly (5.4.0) but still managed to squeeze in a new function:

  • new function :func:navis.sholl_analysis
  • plotly is now correctly chosen as default backend in Google colab
  • fixes a critical bug with plotting skeletons with plotly 5.4.0

v1.0.0

2 years ago

This new version comes packed with goodies (including breaking changes)! Here are the highlights:

  • new neuron type VoxelNeuron for image-type neurons
  • conversion between neuron types (e.g. meshing VoxelNeurons or skeletonising MeshNeurons)
  • new plotting function plot_flat for dendrogram style figures
  • function names now better reflect what neuron type they work on (e.g. reroot_neuron is now called reroot_skeleton)

Check out the changelog for a full list.

v0.6.0

3 years ago

This new version comes with tons of goodies:

Multi-core processing as (almost) first-class citizen

Many functions now accept a parallel=True. If the input is a NeuronList, navis will then use multiple cores to run that function. You can use n_cores=some number (defaults to half the available cores) to set the number of cores used.

A toy example:

>>> nl = navis.example_neurons(4)
>>> pr = navis.prune_by_strahler(nl, to_prune=1, parallel=True)

To run generic (i.e. non-navis functions) in parallel you can use NeuronList.apply:

>>> nl = navis.example_neurons(4)
>>> nl.apply(lambda x: x.id, parallel=True)
[1734350788, 1734350908, 722817260, 754534424]

Note that this requires that you install pathos:

$ pip3 install pathos -U

Read and write SWC files directly from/to zip files

>>> nl = navis.example_neurons(4)
>>> # Write to zip
>>> navis.write_swc(nl, '~/Downloads/SWCs.zip')
>>> # Read from zip
>>> unzipped = navis.read_swc('~/Downloads/SWCs.zip')

Unit awareness

For a while now, navis neurons had an (optional) units property, and some downstream libraries (e.g. fafbseg and pymaid) make use of that:

>>> # Example neurons are in raw (i.e. voxel) hemibrain space
>>> n = navis.example_neurons(1)
>>> n.units
8 <Unit('nanometer')>

Under the hood, this is using a neat library called pint which also lets you convert between units. So you can do stuff like this:

>>> # Example neuron is in 8nm voxels (see above)
>>> n_vxl = navis.example_neurons(1)
>>> # Convert to microns
>>> n_um = n_vxl.convert_units('um')
>>> n_um.units
1.0 <Unit('micrometer')>

Likewise, many navis functions that work with spatial units now alternatively accept a "unit str" that can be parsed by pint. For example:

>>> n = navis.example_neurons(1)
>>> # Prune twigs smaller than 5 microns
>>> # (which would be 5 * 1000 / 8 = 625 in this neuron's space)
>>> n_pr = navis.prune_twigs(n, '5 microns')

New functions

  • navis.prune_at_depth: to prune at given distance from root
  • navis.read_rda: read nat neuron-data R data (.rda) - also works for basic stuff like dataframes
  • navis.cell_body_fiber: prune neuron down to its cell body fiber

For a complete list of changes, see the change log and the commit history.