maweigert / gputools

GPU accelerated image/volume processing in Python
BSD 3-Clause "New" or "Revised" License
108 stars 20 forks source link

Add support for mode reflect in convolve spatial #19

Closed jni closed 4 years ago

jni commented 4 years ago

Some googling showed that this corresponds to CLK_ADDRESS_MIRRORED_REPEAT. I have checked that it runs, and that the results are indeed different from constant mode, but not for correctness.

jni commented 4 years ago

I've also added numpy reflect padding to the convolve function, since it was already implemented in tile_iterator.

maweigert commented 4 years ago

Great, thanks!

jni commented 4 years ago

@maweigert I noticed you swapped out nearest for edge, presumably modelling it after numpy pad. Unfortunately numpy pad modes and ndimage modes are different, see here and here. imho gputools should probably model itself more closely around ndimage, rather than numpy, but I'm not so sure. Have you thought about the pros and cons of each?