Skip to content

Commit 3a289bc

Browse files
fix: handle different types of input to cross sectional area
1 parent a1d20f8 commit 3a289bc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

kimimaro/utility.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,14 @@ def cross_sectional_area_helper(skel, binimg, roi):
249249
cross_sectional_area_helper
250250
)
251251

252-
for skel in skeletons.values():
252+
if isinstance(skeletons, Skeleton):
253+
skelitr = [ skeletons ]
254+
elif isinstance(skeletons, dict):
255+
skelitr = skeletons.values()
256+
else:
257+
skelitr = iter(skeletons)
258+
259+
for skel in skelitr:
253260
add_property(skel, xs_prop)
254261
add_property(skel, xs_contact_prop)
255262

0 commit comments

Comments
 (0)