imeka / ndarray-ndimage

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

Padding #3

Closed nilgoyette closed 2 years ago

nilgoyette commented 2 years ago

This PR modifies the pad function to

I believe it is much cleaner than NumPy version but it is also slower :( In fact, we're around 2-4x slower than NumPy, depending on the mode. See #4 for more information.

The ndarray-stats dependency was added.

nilgoyette commented 2 years ago

Also as a general comment I think we could use https://docs.rs/ndarray/latest/ndarray/struct.ArrayBase.html#method.multi_slice_mut To try to simplify the data manipulation no ?

Using multi_slice_mut could replace my 2 buffers, but I don't believe it's possible: