Skip to content

Commit

Permalink
perf: faster statistics calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Nov 16, 2024
1 parent 454d9cd commit df66ad9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cc3d/fastcc3d.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,8 @@ def _statistics_helper2d(
if no_slice_conversion:
return output
cdef BBOX_T xs = 0, xe = 0, ys = 0, ye = 0
slices = []
for xs, xe, ys, ye in bbxes:
if xs < voxels and ys < voxels:
Expand Down Expand Up @@ -891,6 +893,11 @@ def _statistics_helper3d(
if no_slice_conversion:
return output
cdef:
BBOX_T xs = 0, xe = 0
BBOX_T ys = 0, ye = 0
BBOX_T zs = 0, ze = 0
slices = []
for xs, xe, ys, ye, zs, ze in bbxes:
if xs < voxels and ys < voxels and zs < voxels:
Expand Down

0 comments on commit df66ad9

Please sign in to comment.