BlueBrain / NeuroM

Neuronal Morphology Analysis Tool
https://neurom.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
102 stars 55 forks source link

allow registration of neurite, neuron features to neurom.get utility #513

Closed juanchopanza closed 7 years ago

juanchopanza commented 8 years ago

Currently the neurom.get utility provides a means to obtain various morphometrics while remaining de-coupled from code complexities. This is particularly useful for scripting morphometrics utilities. It would be useful to provide some limited entry points for user defined functions to be utilized with neurom.get. For example:

import neurom as nm

def foo(neurite):
    return something_to_do_with_neurite

nm.register_neurite_feature('foo', foo)

nrn = nm.load_neuron(....)
foos = nm.get('foo', nrn)  # array of whatever foo returns for each neurite

masking of previously existing features would be disallowed:

nm.register_neurite_feature('section_lengths', foo) # Error!
mgeplf commented 7 years ago

done in #537