neurom.ezy.Neuron

class neurom.ezy.Neuron(neuron, iterable_type=<built-in function array>)

Bases: neurom.core.neuron.Neuron

Class with basic analysis and plotting functionality

By default returns iterables as numpy.arrays and applies no filtering.

Parameters:
  • neuron – neuron-like object
  • iterable_type – type of iterable to return from methods returning collections (e.g list, tuple, numpy.array).
Raises:
  • neurom.exceptions.SomaError if no soma can be built from the data
  • neurom.exceptions.IDSequenceError if ID sequence invalid

Example

get the segment lengths of all apical dendrites in a neuron morphology.

>>> from neurom import ezy
>>> nrn = ezy.load_neuron('test_data/swc/Neuron.swc')
>>> nrn.get_segment_lengths(ezy.TreeType.apical_dendrite)

Example

iterate over the segment surface areas of all axons in a neuron morphology.

>>> from neurom import ezy
>>> from neurom.analysis import morphmath as mm
>>> nrn = ezy.load_neuron('test_data/swc/Neuron.swc')
>>> for a in nrn.iter_segments(mm.segment_area, ezy.TreeType.axon):
      print (a)

Example

calculate the mean volume of all neurite segments on a neuron morphology

>>> from neurom import ezy
>>> from neurom.analysis import morphmath as mm
>>> import numpy as np
>>> nrn = ezy.load_neuron('test_data/swc/Neuron.swc')
>>> mv = np.mean([v for v in nrn.iter_segments(mm.segment_volume)])

Example

use lists instead of numpy arrays and get section lengths for the axon. Read an HDF5 v1 file:

>>> from neurom import ezy
>>> nrn = ezy.load_neuron('test_data/h5/v1/Neuron.h5', iterable_type=list)
>>> nrn.get_section_lengths(ezy.TreeType.axon)

Example

plot the neuron and save to a file

>>> fig, ax = nrn.plot()
>>> fig.show()
>>> fig.savefig('nrn.png')

Methods