From 3a289bc7116d192a8b6116dc36b1486b50f135a7 Mon Sep 17 00:00:00 2001 From: William Silversmith Date: Fri, 2 Aug 2024 19:38:21 -0400 Subject: [PATCH] fix: handle different types of input to cross sectional area --- kimimaro/utility.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/kimimaro/utility.py b/kimimaro/utility.py index c01d177..ab64dfc 100644 --- a/kimimaro/utility.py +++ b/kimimaro/utility.py @@ -249,7 +249,14 @@ def cross_sectional_area_helper(skel, binimg, roi): cross_sectional_area_helper ) - for skel in skeletons.values(): + if isinstance(skeletons, Skeleton): + skelitr = [ skeletons ] + elif isinstance(skeletons, dict): + skelitr = skeletons.values() + else: + skelitr = iter(skeletons) + + for skel in skelitr: add_property(skel, xs_prop) add_property(skel, xs_contact_prop)