@@ -0,0 +1,1268 @@
+%0Apackage net.imagej.ops.fft.filter;%0A%0Aimport net.imglib2.img.Img;%0Aimport net.imglib2.type.numeric.ComplexType;%0Aimport net.imglib2.type.numeric.RealType;%0A%0A/**%0A * Abstract class for linear filters that operate on RAIs%0A * %0A * @author bnorthan%0A * @param %3CI%3E%0A * @param %3CO%3E%0A * @param %3CK%3E%0A * @param %3CC%3E%0A */%0Apublic abstract class LinearFFTFilterRAI%3CI extends RealType%3CI%3E, O extends RealType%3CO%3E, K extends RealType%3CK%3E, C extends ComplexType%3CC%3E%3E%0A%09extends AbstractFFTFilterRAI%3CI, O, K, C%3E%0A%7B%0A%0A%09@Override%0A%09public void run() %7B%0A%0A%09%09// perform input FFT if needed%0A%09%09if (performInputFFT) %7B%0A%09%09%09ops.run(%22fft%22, fftInput, raiExtendedInput);%0A%09%09%7D%0A%0A%09%09// perform kernel FFT if needed%0A%09%09if (performKernelFFT) %7B%0A%09%09%09ops.run(%22fft%22, fftKernel, raiExtendedKernel);%0A%09%09%7D%0A%0A%09%09// perform the operation in frequency domain (ie multiplication for%0A%09%09// convolution, complex conjugate multiplication for correlation,%0A%09%09// etc.) Wiener Filter,%0A%09%09frequencyOperation(fftInput, fftKernel);%0A%0A%09%09// inverse fft%0A%09%09ops.run(%22ifft%22, output, fftInput);%0A%09%7D%0A%0A%09// abstract function that implements an operation in frequency domain (ie%0A%09// multiplication for convolution,%0A%09// complex conjugate multiplication for correlation, Wiener Filter, etc.)%0A%09protected abstract void frequencyOperation(final Img%3CC%3E a, final Img%3CC%3E b);%0A%7D%0A

Add LinearFFTFilterRAI