Skip to content

Commit

Permalink
Use section_length from section.py
Browse files Browse the repository at this point in the history
  • Loading branch information
eleftherioszisis committed Mar 15, 2022
1 parent 17060f5 commit 1ba9840
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions neurom/features/neurite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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
)


Expand Down

0 comments on commit 1ba9840

Please sign in to comment.