imeka / ndarray-ndimage

Multidimensional image processing for ndarray
Apache License 2.0
14 stars 2 forks source link

Add structure parameter to label (and friends) #22

Closed matsjoyce-refeyn closed 1 year ago

matsjoyce-refeyn commented 1 year ago

Extend label and largest_connected_components to support any (valid) 3D kernel, based on what scipy does. From my timing, this results in no observable change in execution time for the star kernel (and eyeballing it, the only lost optimisation I can see is a possible unrolling the kernel_data loop). However, this is a more disruptive API change, so I could adjust things so that label keeps it's interface and I add another label_with_kernel function if you want.

Tests run with rustc 1.72.0 and ndarray 0.15.6.