neuromΒΆ

NeuroM neurom morphology analysis package

Examples

Load a neuron

>>> import neurom as nm
>>> nrn = nm.load_neuron('some/data/path/morph_file.swc')

Obtain some morphometrics using the get function

>>> ap_seg_len = nm.get('segment_lengths', nrn, neurite_type=nm.APICAL_DENDRITE)
>>> ax_sec_len = nm.get('section_lengths', nrn, neurite_type=nm.AXON)

Load neurons from a directory. This loads all SWC, HDF5 or NeuroLucida .asc files it finds and returns a list of neurons

>>> import numpy as np  # For mean value calculation
>>> nrns = nm.load_neurons('some/data/directory')
>>> for nrn in nrns:
...     print 'mean section length', np.mean(nm.get('section_lengths', nrn))

Apply a function to a selection of neurites in a neuron or population. This example gets the number of points in each axon in a neuron population

>>> import neurom as nm
>>> filter = lambda n : n.type == nm.AXON
>>> mapping = lambda n : len(n.points)
>>> n_points = [n for n in nm.iter_neurites(nrns, mapping, filter)]

Functions

get Obtain a feature from a set of morphology objects
iter_neurites Iterator to a neurite, neuron or neuron population
iter_sections Iterator to the sections in a neurite, neuron or neuron population.
iter_segments Return an iterator to the segments in a collection of neurites
load_neuron Build section trees from an h5 or swc file
load_neurons Create a population object from all morphologies in a directory of from morphologies in a list of file names

Classes

NeuriteType Enum representing valid tree types
NeuronLoader Caching morphology loader.