
package net.imagej.ops.filter.fft;

import net.imglib2.Dimensions;
import net.imglib2.FinalDimensions;
import net.imglib2.algorithm.fft2.FFTMethods;

/**
 * Utility class that interacts with FFTMethods
 *
 * @author bnorthan
 */
public class FFTMethodsUtility {

	public static void dimensionsRealToComplex(final boolean fast,
		final Dimensions inputDimensions, final long[] paddedDimensions,
		final long[] fftDimensions)
	{
		if (fast) {
			FFTMethods.dimensionsRealToComplexFast(inputDimensions, paddedDimensions,
				fftDimensions);
		}
		else {
			FFTMethods.dimensionsRealToComplexSmall(inputDimensions, paddedDimensions,
				fftDimensions);
		}
	}

	public static Dimensions getPaddedInputDimensionsRealToComplex(
		final boolean fast, final Dimensions inputDimensions)
	{
		final long[] paddedSize = new long[inputDimensions.numDimensions()];
		final long[] fftSize = new long[inputDimensions.numDimensions()];

		dimensionsRealToComplex(fast, inputDimensions, paddedSize, fftSize);

		return new FinalDimensions(paddedSize);

	}

	public static Dimensions getFFTDimensionsRealToComplex(final boolean fast,
		final Dimensions inputDimensions)
	{
		final long[] paddedSize = new long[inputDimensions.numDimensions()];
		final long[] fftSize = new long[inputDimensions.numDimensions()];

		dimensionsRealToComplex(fast, inputDimensions, paddedSize, fftSize);

		return new FinalDimensions(fftSize);

	}

}

@@ -257,16 +257,307 @@
 lity %7B%0A%0A
+%09/**%0A%09 * Calculates padding size and complex FFT size for real to complex FFT%0A%09 * %0A%09 * @param fast if true calculate size for fast FFT%0A%09 * @param inputDimensions original real dimensions%0A%09 * @param paddedDimensions padded real dimensions%0A%09 * @param fftDimensions complex FFT dimensions%0A%09 */%0A
 %09public 
@@ -604,32 +604,32 @@
 l boolean fast,%0A
-
 %09%09final Dimensio
@@ -938,24 +938,235 @@
 s);%0A%09%09%7D%0A%09%7D%0A%0A
+%09/**%0A%09 * Calculates padding size size for real to complex FFT%0A%09 * %0A%09 * @param fast if true calculate size for fast FFT%0A%09 * @param inputDimensions original real dimensions%0A%09 * @return padded real dimensions%0A%09 */%0A
 %09public stat
@@ -1536,16 +1536,226 @@
 );%0A%0A%09%7D%0A%0A
+%09/**%0A%09 * Calculates complex FFT size for real to complex FFT%0A%09 * %0A%09 * @param fast if true calculate size for fast FFT%0A%09 * @param inputDimensions original real dimensions%0A%09 * @return complex FFT dimensions%0A%09 */%0A
 %09public 

Add javadoc