Skip to content

Commit f084079

Browse files
feat: add void filling to cross section estimation
1 parent 0df8c33 commit f084079

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

kimimaro/utility.py

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import cc3d
1111
import fastremap
12+
import fill_voids
1213
import xs3d
1314

1415
def extract_skeleton_from_binary_image(image):
@@ -46,6 +47,7 @@ def cross_sectional_area(
4647
smoothing_window:int = 1,
4748
progress:bool = False,
4849
in_place:bool = False,
50+
fill_holes:bool = False,
4951
) -> Union[Dict[int,Skeleton],List[Skeleton],Skeleton]:
5052
"""
5153
Given a set of skeletons, find the cross sectional area
@@ -94,6 +96,9 @@ def cross_sectional_area(
9496

9597
binimg = np.asfortranarray(all_labels[slices] == label)
9698

99+
if fill_holes:
100+
binimg = fill_voids.fill(binimg, in_place=True)
101+
97102
all_verts = (skel.vertices / anisotropy).round().astype(int)
98103
all_verts -= roi.minpt
99104

0 commit comments

Comments
 (0)