neurom.fstΒΆ
NeuroM, lightweight and fast
Examples
Load a neuron
>>> from neurom import fst
>>> nrn = fst.load_neuron('some/data/path/morph_file.swc')
Obtain some morphometrics
>>> ap_seg_len = fst.get('segment_lengths', nrn, neurite_type=fst.NeuriteType.apical_dendrite)
>>> ax_sec_len = fst.get('section_lengths', nrn, neurite_type=fst.NeuriteType.axon)
Load neurons from a directory. This loads all SWC or HDF5 files it finds and returns a list of neurons
>>> import numpy as np # For mean value calculation
>>> nrns = fst.load_neurons('some/data/directory')
>>> for nrn in nrns:
... print 'mean section length', np.mean(fst.get('section_lengths', nrn))
Iterate over all the sections in a neuron
>>> for s in fst.iter_sections(nrn): print s.points[0][:3]
Functions
get |
Obtain a feature from a set of morphology objects |
iter_sections |
Returns an iterator to the nodes in a iterable of neurite objects |
iter_segments |
Return an iterator to the segments in a collection of neurites |
load_neuron |
Build section trees from an h5 or swc file |
Classes
Neurite |
Class representing a neurite tree |
Neuron |
Class representing a neuron |
Section |
Class representing a neurite section |