Skip to content

Commit

Permalink
Modify scanline functions for monocots. (#43)
Browse files Browse the repository at this point in the history
Co-authored-by: Lin Wang <linwang9926@gmail.com>
  • Loading branch information
linwang9926 and Lin Wang authored Jul 7, 2023
1 parent f5dab2b commit ab2642e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sleap_roots/scanline.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def count_scanline_intersections(
"""
# connect the points to lines using shapely
if monocots:
points = list(primary_pts)
points = list(lateral_pts)
else:
points = list(primary_pts) + list(lateral_pts)

Expand All @@ -41,7 +41,7 @@ def count_scanline_intersections(
horizontal_line_y = n_interval * (i + 1)
intersection_line = 0

for j in range(len(points) - 1):
for j in range(len(points)):
intersection_counts_root = 0
# filter out nan nodes
pts_j = np.array(points[j])[~np.isnan(points[j]).any(axis=1)]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_scanline.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ def test_get_scanline_last_ind(canola_h5):
scanline_last_ind = get_scanline_last_ind(
primary_pts, lateral_pts, depth, width, n_line, monocots
)
np.testing.assert_equal(scanline_last_ind, np.nan)
np.testing.assert_equal(scanline_last_ind, 15)

0 comments on commit ab2642e

Please sign in to comment.