Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Library for manipulating neuromorpho resources.

Project description

neuromorpholib

Codecov PyPI) GitHub Workflow Status

Installation

pip3 install neuromorpholib

Usage

Downloading

A simple download of known dataset and name

from neuromorpholib import neuromorpho

nmo = neuromorpho.NeuroMorpho()
acc1 = nmo.download_swc("martone", "ACC1")

A query for all species=mouse neurons

mouse_neurons = nmo.search({"species": "mouse"})

Download a SWC for a mouse neuron

swc_demo = nmo.download_swc(
    mouse_neurons[0]
)

If you know the archive name and neuron name, you can also download the swc directly by passing archive and neuron_name arguments.

If you only want the SWC text and don't want it to be converted into a NeuronMorphology object, you can pass text_only=True.

SWC Management

Read a SWC file from disk

from neuromorpholib.swc import load_swc, NeuronMorphology

my_morphology = load_swc("my_neuron.swc")
# This is a NeuronMorphology object.

Get a list of branch points

branch_points = my_morphology.get_branch_points()

Get a simplified graph (only leaves and branch points) of a morphology

morphology_graph = my_morphology.smoothed()
# nx.DiGraph

SWC Geometry Operations

Rotate, translate, or scale a geometry with NeuronMorphology functions:

n = NeuronMorphology()
n.scale(3)
n.translate([4, 44, 10])
n.rotate([0, 0, math.pi/2])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for neuromorpholib, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size neuromorpholib-0.2.0.tar.gz (7.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page