Skip to content
This repository has been archived by the owner on Feb 26, 2025. It is now read-only.

Commit

Permalink
Use iter_sections instead of obj.sections in check.morphtree
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-berchet committed Apr 17, 2024
1 parent af8644c commit 4d212ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions neurom/check/morphtree.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

from neurom import morphmath as mm
from neurom.core.dataformat import COLS
from neurom.core.morphology import iter_sections
from neurom.morphmath import principal_direction_extent


Expand All @@ -47,7 +48,7 @@ def is_monotonic(neurite, tol):
Returns:
True if neurite monotonic
"""
for node in neurite.sections:
for node in iter_sections(neurite):
# check that points in section satisfy monotonicity
sec = node.points
for point_id in range(len(sec) - 1):
Expand Down Expand Up @@ -171,7 +172,7 @@ def is_inside_cylinder(seg1, seg2):
return not is_in_the_same_verse(seg1, seg2) and is_seg1_overlapping_with_seg2(seg1, seg2)

# filter out single segment sections
section_itr = (sec for sec in neurite.sections if sec.points.shape[0] > 2)
section_itr = (sec for sec in iter_sections(neurite) if sec.points.shape[0] > 2)
for sec in section_itr:
# group each section's points intro triplets
segment_pairs = list(filter(is_not_zero_seg, pair(sec.points)))
Expand Down

0 comments on commit 4d212ae

Please sign in to comment.