imagej/imagej-ops — pull request #33 by bnorthan (2014-08-07 12:39:12+00:00)
Title: Convolve fix

I noticed that the ConvolveFourier op was failing with an out of bounds error. The version of 'FFTConvolution.create' function used seems to require extended inputs. (From the documentation of the function: "The input as well as the kernel need to be extended or infinite already as the {@link Interval} required to perform the Fourier convolution is significantly bigger than the {@link Interval} provided here.")

There is an alternative version of FFTConvolution.create that takes non-extended RAIs as input and extends the image using a mirror and the kernel by zero.

My proposed solution is to:

1. Use the alternative version of FFTConvolution.create in the default ConvolveFourier op.
2. In the future add a variation of ConvolveFourier that takes a flag indicating type of boundary extension to use (thus allowing the caller to choose a different type of boundary such as zero, exponential fade, etc). In this version of the op pre-extend the inputs as desired before calling FFTConvolution.create.

I also added a test to run a convolution and check the output.