Skip to content

Latest commit

 

History

History
90 lines (64 loc) · 3.71 KB

examples.rst

File metadata and controls

90 lines (64 loc) · 3.71 KB

Examples

Fast analysis with :pyneurom

Here we load a neuron and obtain some information from it:

>>> import neurom as nm
>>> nrn = nm.load_neuron('some/data/path/morph_file.swc')
>>> 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)

Morphology visualization with the :pyneurom.viewer module

Here we visualize a neuronal morphology:

>>> # Initialize nrn as above
>>> from neurom import viewer
>>> fig, ax = viewer.draw(nrn)
>>> fig.show()
>>> fig, ax = viewer.draw(nrn, mode='3d') # valid modes '2d', '3d', 'dendrogram'
>>> fig.show()

Basic feature extraction example

These basic examples illustrate the type of morphometrics that can be easily obtained directly from the neurom module, without the need for any other neurom sub-modules or tools.

The idea here is to pre-package the most common analyses so that users can obtain the morphometrics with a very minimal knowledge of python and neurom.

../../examples/get_features.py

Advanced iterator-based feature extraction example

These slightly more complex examples illustrate what can be done with the neurom module's various generic iterators and simple morphometric functions.

The idea here is that there is a great deal of flexibility to build new analyses based on some limited number of orthogonal iterator and morphometric components that can be combined in many ways. Users with some knowledge of python and neurom can easily implement code to obtain new morphometrics.

All of the examples in the previous sections can be implemented in a similar way to those presented here.

../../examples/neuron_iteration_analysis.py