Skip to content

Commit

Permalink
feat: also compute border contacts for cross sectional area
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Feb 8, 2024
1 parent 9520421 commit b8a9756
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kimimaro/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def cross_sectional_area(
mapping = { tuple(v): i for i, v in enumerate(all_verts) }

areas = np.zeros([all_verts.shape[0]], dtype=np.float32)
contacts = np.zeros([all_verts.shape[0]], dtype=np.uint8)

paths = skel.paths()

Expand All @@ -122,13 +123,15 @@ def cross_sectional_area(
normal = normals[i]

if areas[idx] == 0:
areas[idx] = xs3d.cross_sectional_area(
areas[idx], contacts[idx] = xs3d.cross_sectional_area(
binimg, vert,
normal, anisotropy,
return_contact=True,
)

skel.extra_attributes.append(prop)
skel.cross_sectional_area = areas
skel.cross_sectional_area_contacts = contacts

return skeletons

Expand Down

0 comments on commit b8a9756

Please sign in to comment.