Search in sources :

Example 1 with PadShiftKernelFFTMethods

use of net.imagej.ops.filter.pad.PadShiftKernelFFTMethods in project imagej-ops by imagej.

the class FFTTest method testPadShiftKernel.

@Test
@SuppressWarnings("unchecked")
public void testPadShiftKernel() {
    long[] dims = new long[] { 1024, 1024 };
    Img<ComplexDoubleType> test = ops.create().img(new FinalDimensions(dims), new ComplexDoubleType());
    RandomAccessibleInterval<ComplexDoubleType> shift = (RandomAccessibleInterval<ComplexDoubleType>) ops.run(PadShiftKernel.class, test, new FinalDimensions(dims));
    RandomAccessibleInterval<ComplexDoubleType> shift2 = (RandomAccessibleInterval<ComplexDoubleType>) ops.run(PadShiftKernelFFTMethods.class, test, new FinalDimensions(dims));
    // assert there was no additional padding done by PadShiftKernel
    assertEquals(1024, shift.dimension(0));
    // assert that PadShiftKernelFFTMethods padded to the FFTMethods fast size
    assertEquals(1120, shift2.dimension(0));
}
Also used : FinalDimensions(net.imglib2.FinalDimensions) RandomAccessibleInterval(net.imglib2.RandomAccessibleInterval) PadShiftKernelFFTMethods(net.imagej.ops.filter.pad.PadShiftKernelFFTMethods) ComplexDoubleType(net.imglib2.type.numeric.complex.ComplexDoubleType) PadShiftKernel(net.imagej.ops.filter.pad.PadShiftKernel) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test)

Aggregations

AbstractOpTest (net.imagej.ops.AbstractOpTest)1 PadShiftKernel (net.imagej.ops.filter.pad.PadShiftKernel)1 PadShiftKernelFFTMethods (net.imagej.ops.filter.pad.PadShiftKernelFFTMethods)1 FinalDimensions (net.imglib2.FinalDimensions)1 RandomAccessibleInterval (net.imglib2.RandomAccessibleInterval)1 ComplexDoubleType (net.imglib2.type.numeric.complex.ComplexDoubleType)1 Test (org.junit.Test)1