aoles / EBImage

:art: Image processing toolbox for R
71 stars 28 forks source link

filter2 not working with n x 1 matrices #54

Open balwierz opened 3 years ago

balwierz commented 3 years ago

Hi,

I am getting an error while running filter2 on a 1-column matrix: EBImage::filter2(matrix(rnorm(10), ncol = 1), filter = matrix(c(0.25, 0.5, 0.25), ncol = 1))

Error in res[idxRowAppend, nC:2] : subscript out of bounds

There is no problem with a "transposed" (horizontal) call: EBImage::filter2(matrix(rnorm(10), nrow = 1), filter = matrix(c(0.25, 0.5, 0.25), nrow = 1))

Nor is there a problem with applying a 1-column filter on a multi-dimensional data: EBImage::filter2(matrix(rnorm(10), ncol = 2), filter = matrix(c(0.25, 0.5, 0.25), ncol = 1))

aoles commented 3 years ago

Hi there! :)

Thanks for pointing this out. Actually, the error comes from the upstream function fftwtools::fftw2d. Would you mind reporting this to the maintainer of fftwtools?

Cheers! Andrzej

balwierz commented 3 years ago

Thanks :) Reported as https://github.com/krahim/fftwtools/issues/14