From 1ba984062b7ab5c49347357f3d3522e291c07348 Mon Sep 17 00:00:00 2001 From: Eleftherios Zisis Date: Tue, 15 Mar 2022 23:46:08 +0100 Subject: [PATCH] Use section_length from section.py --- neurom/features/neurite.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/neurom/features/neurite.py b/neurom/features/neurite.py index 36a8e51d..d67e85dc 100644 --- a/neurom/features/neurite.py +++ b/neurom/features/neurite.py @@ -82,6 +82,7 @@ def homogeneous_filter(section): @feature(shape=()) def max_radial_distance(neurite, origin=None, section_type=NeuriteType.all): """Get the maximum radial distances of the termination sections.""" + term_radial_distances = section_term_radial_distances( neurite, origin=origin, section_type=section_type ) @@ -151,28 +152,23 @@ def total_volume(neurite, section_type=NeuriteType.all): return sum(_map_sections(sf.section_volume, neurite, section_type=section_type)) -def _section_length(section): - """Get section length of `section`.""" - return morphmath.section_length(section.points) - - @feature(shape=(...,)) def section_lengths(neurite, section_type=NeuriteType.all): """Section lengths.""" - return _map_sections(_section_length, neurite, section_type=section_type) + return _map_sections(sf.section_length, neurite, section_type=section_type) @feature(shape=(...,)) def section_term_lengths(neurite, section_type=NeuriteType.all): """Termination section lengths.""" - return _map_sections(_section_length, neurite, Section.ileaf, section_type=section_type) + return _map_sections(sf.section_length, neurite, Section.ileaf, section_type=section_type) @feature(shape=(...,)) def section_bif_lengths(neurite, section_type=NeuriteType.all): """Bifurcation section lengths.""" return _map_sections( - _section_length, neurite, Section.ibifurcation_point, section_type=section_type + sf.section_length, neurite, Section.ibifurcation_point, section_type=section_type )