neuron_morphology.feature_extractor.feature_extractor module

class neuron_morphology.feature_extractor.feature_extractor.FeatureExtractor(features: Sequence[Union[Callable[[neuron_morphology.feature_extractor.data.Data], Any], neuron_morphology.feature_extractor.marked_feature.MarkedFeature]] = ())[source]

Bases: object

Methods

extract(self, data, only_marks, …) Run the feature extractor for a single dataset
register_features(self, features, Any], …) Add a new feature to the list of options
extract(self, data: neuron_morphology.feature_extractor.data.Data, only_marks: Union[AbstractSet[Type[neuron_morphology.feature_extractor.mark.Mark]], NoneType] = None, required_marks: AbstractSet[Type[neuron_morphology.feature_extractor.mark.Mark]] = frozenset()) → neuron_morphology.feature_extractor.feature_extraction_run.FeatureExtractionRun[source]

Run the feature extractor for a single dataset

Parameters:
data : the dataset from which features will be calculated
only_marks : if provided, reject marks not in this set
required_marks : if provided, raise an exception if any of these marks

do not validate successfully

Returns:
The calculated features, along with a record of the marks and features

selected.

register_features(self, features: Sequence[Union[Callable[[neuron_morphology.feature_extractor.data.Data], Any], neuron_morphology.feature_extractor.marked_feature.MarkedFeature, Mapping[Any, Union[Callable[[neuron_morphology.feature_extractor.data.Data], Any], neuron_morphology.feature_extractor.marked_feature.MarkedFeature]], Iterable[Union[Callable[[neuron_morphology.feature_extractor.data.Data], Any], neuron_morphology.feature_extractor.marked_feature.MarkedFeature]]]])[source]

Add a new feature to the list of options

Parameters:
features : the features to be registered. If it is not already marked,

it will be registered with no marks