Skip to content
/ navis Public
forked from navis-org/navis

Python 3 library for Neuron Analysis and Visualization

License

Notifications You must be signed in to change notification settings

bocklab/navis

 
 

Repository files navigation

Documentation Status Tests Run notebooks Coverage Status Open In Colab DOI Downloads

NAVis is a Python 3 library for Neuron Analysis and Visualization.

Documentation

NAVis is on ReadTheDocs.

Features

  • polyglot: navis works with skeletons,meshes dotprops and image data
  • visualize: 2D (matplotlib) and 3D (vispy, plotly or k3d)
  • process: skeletonization, smoothing, repair, downsampling, etc.
  • surgery: e.g. cutting, stitching, pruning, rerooting or intersections
  • morphometrics: Strahler analysis, cable length, volume, tortuosity and more
  • similarity: compare & cluster by morphology (e.g. NBLAST, persistence, form factor) or connectivity metrics
  • transform: move data between template brains (built-in support for HDF5, CMTK, Elastix and landmark-based transforms)
  • interface: load neurons directly from neuPrint, neuromorpho.org and other data sources
  • simulate neurons and networks using the NEURON simulator
  • render: use Blender 3D for high quality visualizations
  • R neuron libraries: interfaces with nat, rcatmaid, elmr and more
  • import-export: read/write SWCs, neuroglancer's "precomputed" format, NMX/NML, NRRD, mesh-files and more
  • scalable: out-of-the-box support for multiprocessing
  • extensible: build your own package on top of navis - see for example pymaid

Getting started

See the documentation for detailed installation instructions, tutorials and examples. For the impatient:

pip3 install 'navis[all]'

which includes all optional extras providing features and/or performance improvements. Currently, this is igraph, pathos, shapely, kdtree, hash, flybrains, cloudvolume, meshes, and vispy-default.

3D plotting from a python REPL is provided by vispy, which has a choice of backends. Different backends work best on different combinations of hardware, OS, python distribution, and REPL, so there may be some trial and error involved. vispy's backends are listed here, and each can be installed as a navis extra, e.g. pip3 install 'navis[vispy-pyqt6]'.

movie

Changelog

A summary of changes can be found here.

NAVis & friends

NAVis comes with batteries included but is also highly extensible. Some libraries built on top of NAVis:

  • flybrains provides templates and transforms for Drosophila brains to use with navis
  • pymaid pulls and pushes data from/to CATMAID servers
  • fafbseg contains tools to work with auto-segmented data for the FAFB EM dataset including FlyWire

Who uses NAVis?

NAVis has been used in a range of neurobiological publications. Here's a semi-random sample of recent papers:

BIFROST: a method for registering diverse imaging datasets, Brezovec et al., bioRxiv (2023); doi: https://doi.org/10.1101/2023.06.09.544408

Vimo: Visual Analysis of Neuronal Connectivity Motifs, Troidl et al., bioRxiv (2022); doi: https://doi.org/10.1101/2022.12.09.519772

Information flow, cell types and stereotypy in a full olfactory connectome, Schlegel, Bates et al., eLife (2021); doi: https://doi.org/10.7554/eLife.66018

Synaptic wiring motifs in posterior parietal cortex support decision-making, Kuan et al., bioRxiv (2022); doi: https://doi.org/10.1101/2022.04.13.488176

Want to see your work listed here? Open an Issue and tell us about it!

Citing NAVis

We'd love to know if you found NAVis useful for your research! You can help us spread the word by citing the DOI provided by Zenodo DOI

License

This code is under GNU GPL V3.

Acknowledgments

NAVis is inspired by and inherits much of its design from the excellent natverse R packages by Greg Jefferis, Alex Bates, James Manton and others.

References

NAVis implements or provides interfaces with algorithms described in:

  1. Comparison of neurons based on morphology: Neuron. 2016 doi: 10.1016/j.neuron.2016.06.012 NBLAST: Rapid, Sensitive Comparison of Neuronal Structure and Construction of Neuron Family Databases. Costa M, Manton JD, Ostrovsky AD, Prohaska S, Jefferis GSXE. link
  2. Comparison of neurons based on connectivity: Science. 2012 Jul 27;337(6093):437-44. doi: 10.1126/science.1221762. The connectome of a decision-making neural network. Jarrell TA, Wang Y, Bloniarz AE, Brittin CA, Xu M, Thomson JN, Albertson DG, Hall DH, Emmons SW. link
  3. Comparison of neurons based on synapse distribution: eLife. doi: 10.7554/eLife.16799 Synaptic transmission parallels neuromodulation in a central food-intake circuit. Schlegel P, Texada MJ, Miroschnikow A, Schoofs A, Hückesfeld S, Peters M, … Pankratz MJ. link
  4. Synapse flow centrality and segregation index: eLife. doi: 10.7554/eLife.12059 Quantitative neuroanatomy for connectomics in Drosophila. Schneider-Mizell CM, Gerhard S, Longair M, Kazimiers T, Li, Feng L, Zwart M … Cardona A. link

Contributing

  1. Fork this repository
  2. git clone it to your local machine
  3. Install the full development dependencies with pip install -r requirements.txt
  4. Install the package in editable mode with pip install -e ".[all]"
  5. Create, git add, git commit, git push, and pull request your changes.

Run the tests locally with pytest -v.

Docstrings should use the numpydoc format, and make sure you include any relevant links and citations. Unit tests should be doctests and/or use pytest in the ./tests directory.

Doctests have access to the tmp_dir: pathlib.Path variable, which should be used if any files need to be written.

About

Python 3 library for Neuron Analysis and Visualization

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.9%
  • Other 0.1%