Skip to content

Commit

Permalink
update segment sort stop editing tip info
Browse files Browse the repository at this point in the history
  • Loading branch information
HaleySchuhl committed Dec 19, 2024
1 parent 0ea3128 commit 66f25fb
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions plantcv/plantcv/morphology/segment_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from plantcv.plantcv import params
from plantcv.plantcv import outputs
from plantcv.plantcv import logical_and
from plantcv.plantcv.morphology import find_tips
from plantcv.plantcv.morphology import _find_tips
from plantcv.plantcv._debug import _debug


Expand Down Expand Up @@ -47,7 +47,7 @@ def segment_sort(skel_img, objects, mask=None, first_stem=True):
else:
labeled_img = mask.copy()

tips_img = find_tips(skel_img)
tips_img, _, _ = _find_tips(skel_img)
tips_img = dilate(tips_img, 3, 1)

# Loop through segment contours
Expand All @@ -59,10 +59,6 @@ def segment_sort(skel_img, objects, mask=None, first_stem=True):
# The first contour is the base, and while it contains a tip, it isn't a leaf
if i == 0 and first_stem:
primary_objects.append(cnt)
# Remove the first "tip" since it corresponds to stem not leaf. This helps
# leaf number to match the number of "tips"
outputs.observations[label]["tips"]["value"] = outputs.observations[label]["tips"]["value"][1:]
outputs.observations[label]["tips"]["label"] = outputs.observations[label]["tips"]["label"][:-1]

# Sort segments
else:
Expand Down

0 comments on commit 66f25fb

Please sign in to comment.