morph_stats: morphometric statistics extraction

The morph_stats application extracts morphometrics from a set of neuron morphology files and produces a summary in JSON or CSV format. It may obtain any of the morphometrics available in the neurom.get() function, and is highly configurable, allowing the user to get raw or summary statistics from a large set of neurite and neuron features.

The functionality can be best explained by looking at a sample configuration file:

neurite:
    section_lengths:
        - max
        - total
    section_volumes:
        - total
    section_branch_orders:
        - max

neurite_type:
    - AXON
    - APICAL_DENDRITE
    - BASAL_DENDRITE
    - ALL

neuron:
    soma_radii:
        - mean

Here, there are two feature categories,

  1. neurite: these are morphometrics obtained from neurites, e.g. branch orders, section lengths, bifurcation angles, path lengths.
  2. neuron: these are morphometrics that can be applied to a whole neuron, e.g. the soma radius, the trunk radii, etc.

Each category sub-item (section_lengths, soma_radii, etc) corresponds to a neurom.get() feature, and each one of its sub-items corresponds to a statistic, e.g.

  • raw: array of raw values
  • max, min, mean, median, std: self-explanatory.
  • total: sum of the raw values

An additional field neurite_type specifies the neurite types into which the morphometrics are to be split. This is a sample output using the above configuration:

{
  "some/path/morph.swc":{
    "mean_soma_radius":0.17071067811865476,
    "axon":{
      "total_section_length":207.87975220908129,
      "max_section_length":11.018460736176685,
      "max_section_branch_order":10,
      "total_section_volume":276.73857657289523
    },
    "all":{
      "total_section_length":840.68521442251949,
      "max_section_length":11.758281556059444,
      "max_section_branch_order":10,
      "total_section_volume":1104.9077419665782
    },
    "apical_dendrite":{
      "total_section_length":214.37304577550353,
      "max_section_length":11.758281556059444,
      "max_section_branch_order":10,
      "total_section_volume":271.9412385728449
    },
    "basal_dendrite":{
      "total_section_length":418.43241643793476,
      "max_section_length":11.652508126101711,
      "max_section_branch_order":10,
      "total_section_volume":556.22792682083821
    }
  }
}

For more information on the application and available options, invoke it with the --help or -h option.

morph_stats --help

Features

$ morph_stats -l
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/neurom/envs/v1.4.4/bin/morph_stats", line 4, in <module>
    __import__('pkg_resources').run_script('neurom==1.4.5', 'morph_stats')
  File "/home/docs/checkouts/readthedocs.org/user_builds/neurom/envs/v1.4.4/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 743, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/docs/checkouts/readthedocs.org/user_builds/neurom/envs/v1.4.4/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1498, in run_script
    exec(code, namespace, namespace)
  File "/home/docs/checkouts/readthedocs.org/user_builds/neurom/envs/v1.4.4/lib/python2.7/site-packages/neurom-1.4.5-py2.7.egg/EGG-INFO/scripts/morph_stats", line 36, in <module>
    from neurom.apps import get_config
  File "/home/docs/checkouts/readthedocs.org/user_builds/neurom/envs/v1.4.4/local/lib/python2.7/site-packages/neurom-1.4.5-py2.7.egg/neurom/apps/__init__.py", line 30, in <module>
    import yaml
ImportError: No module named yaml