Mathematical morphology operators such as ndimage.grey_dilation, ndimage.grey_erosion only offer to pad the input with different modes {‘reflect’,’constant’,’nearest’,’mirror’, ‘wrap’}. It would be nice to be able to do have a valid mode that doesn't do any padding, like in signal.convolve.
At the moment the only way to do a valid dilation is to do a padded dilation, and to crop the output to only keep the valid samples. However this is prone to errors, and this is highly inefficient when the structure size is relatively large compared to the input.
This issue is somewhat related to this other existing issue for ndimage.convolve.
Mathematical morphology operators such as
ndimage.grey_dilation
,ndimage.grey_erosion
only offer to pad the input with different modes{‘reflect’,’constant’,’nearest’,’mirror’, ‘wrap’}
. It would be nice to be able to do have avalid
mode that doesn't do any padding, like insignal.convolve
.At the moment the only way to do a
valid
dilation is to do a padded dilation, and to crop the output to only keep the valid samples. However this is prone to errors, and this is highly inefficient when the structure size is relatively large compared to the input.This issue is somewhat related to this other existing issue for ndimage.convolve.