final public static < C extends ComplexType< C >, R extends RealType< R > > Img< R > complexToReal( final RandomAccessibleInterval< C > input, final ImgFactory< R > factory, final R type, final ExecutorService service ) { return complexToReal( input, input, null, factory, type, service ); }
/** * Computes a complex-to-real inverse FFT transform of an n-dimensional dataset in a certain dimension (typically dim = 0). * By default as many threads as processors are available are used. * By default the real values are scaled (divided by the amount of pixels in the input dataset), this way after performing a forward and reverse FFT, the values will be exactly the same * * @param input - the complex-valued input dataset * @param output - the real-valued output dataset * @param dim - the dimension to compute the inverse FFT in * @return - true if successful, false if the dimensions of input and output are not compatible, i.e. not supported by the edu_mines_jtk 1d fft */ final public static < C extends ComplexType< C >, R extends RealType< R > > boolean complexToReal( final RandomAccessibleInterval< C > input, final RandomAccessibleInterval< R > output, final int dim ) { return complexToReal( input, output, output, dim, true ); }
/** * Computes a real-to-complex forward FFT transform of an n-dimensional dataset in a certain dimension (typically dim = 0). * By default as many threads as processors are available are used. * By default the complex values are not scaled (not divided by the amount of pixels in the input dataset) * * @param input - the real-valued input dataset * @param output - the complex-valued output dataset * @param dim - the dimension to compute the FFT in * @return - true if successful, false if the dimensions of input and output are not compatible, i.e. not supported by the edu_mines_jtk 1d fft */ final public static < R extends RealType< R >, C extends ComplexType< C > > boolean realToComplex( final RandomAccessibleInterval< R > input, final RandomAccessibleInterval< C > output, final int dim ) { return realToComplex( input, output, output, dim, false ); }
final public static < C extends ComplexType< C >, R extends RealType< R > > void complexToRealUnpad( final RandomAccessibleInterval< C > input, final RandomAccessibleInterval< R > output, final ExecutorService service ) { for ( int d = 1; d < input.numDimensions(); ++d ) FFTMethods.complexToComplex( input, d, false, true, service ); FFTMethods.complexToReal( input, output, FFTMethods.unpaddingIntervalCentered( input, output ), 0, true, service ); }
final public static < R extends RealType< R >, C extends ComplexType< C > > void realToComplex( final RandomAccessibleInterval< R > input, final RandomAccessibleInterval< C > output ) { FFTMethods.realToComplex( input, output, 0 ); for ( int d = 1; d < input.numDimensions(); ++d ) FFTMethods.complexToComplex( output, d, true ); }
final public static < C extends ComplexType< C > > void complexToComplexForward( final RandomAccessibleInterval< C > data, final ExecutorService service ) { for ( int d = 0; d < data.numDimensions(); ++d ) FFTMethods.complexToComplex( data, d, true, false, service ); }
/** * Compute a Fourier space based convolution * The image will be extended by mirroring with single boundary, the kernel will be zero-padded. * The {@link ImgFactory} for creating the FFT will be identical to the one used by the 'img' if * possible, otherwise an {@link ArrayImgFactory} or {@link CellImgFactory} depending on the size. * * @param img - the image * @param kernel - the convolution kernel * @param output - the result of the convolution */ public FFTConvolution( final Img< R > img, final Img< R > kernel, final RandomAccessibleInterval< R > output ) { this ( img, kernel, output, getFFTFactory( img ) ); }
final public static < R extends RealType< R >, C extends ComplexType< C > > void realToComplex( final RandomAccessibleInterval< R > input, final RandomAccessibleInterval< C > output, final ExecutorService service ) { FFTMethods.realToComplex( input, output, 0, false, service ); for ( int d = 1; d < input.numDimensions(); ++d ) FFTMethods.complexToComplex( output, d, true, false, service ); }
final public static < C extends ComplexType< C >, R extends RealType< R > > Img< R > complexToReal( final RandomAccessibleInterval< C > input, final ImgFactory< R > factory, final R type, final int numThreads ) { return complexToReal( input, input, null, factory, type, numThreads ); }
/** * Computes a complex-to-real inverse FFT transform of an n-dimensional dataset in a certain dimension (typically dim = 0). * * @param input - the complex-valued input dataset * @param output - the real-valued output dataset * @param dim - the dimension to compute the inverse FFT in * @param scale - define if each pixel is divided by the sum of all pixels in the image * @param numThreads - the number of threads used for the computation (if dataset is more than 1-dimensional) * @return - true if successful, false if the dimensions of input and output are not compatible, i.e. not supported by the edu_mines_jtk 1d fft */ final public static < C extends ComplexType< C >, R extends RealType< R > > boolean complexToReal( final RandomAccessibleInterval< C > input, final RandomAccessibleInterval< R > output, final int dim, final boolean scale, final int numThreads ) { return complexToReal( input, output, output, dim, scale, numThreads ); }
/** * Computes a real-to-complex forward FFT transform of an n-dimensional dataset in a certain dimension (typically dim = 0). * * @param input - the real-valued input dataset * @param output - the complex-valued output dataset * @param dim - the dimension to compute the FFT in * @param scale - define if each pixel is divided by the sum of all pixels in the image * @param numThreads - the number of threads used for the computation (if dataset is more than 1-dimensional) * @return - true if successful, false if the dimensions of input and output are not compatible, i.e. not supported by the edu_mines_jtk 1d fft */ final public static < R extends RealType< R >, C extends ComplexType< C > > boolean realToComplex( final RandomAccessibleInterval< R > input, final RandomAccessibleInterval< C > output, final int dim, final boolean scale, final int numThreads ) { return realToComplex( input, output, output, dim, scale, numThreads ); }
final public static < C extends ComplexType< C >, R extends RealType< R > > Img< R > complexToReal( final RandomAccessible< C > input, final Interval inputInterval, final ImgFactory< R > factory, final R type, final int numThreads ) { return complexToReal( input, inputInterval, null, factory, type, numThreads ); }
/** * Computes a complex-to-real inverse FFT transform of an n-dimensional dataset in a certain dimension (typically dim = 0). * By default as many threads as processors are available are used. * By default the real values are scaled (divided by the amount of pixels in the input dataset), this way after performing a forward and reverse FFT, the values will be exactly the same * * @param input - the complex-valued input dataset * @param output - the real-valued output dataset * @param interval - if just a subset of the real-values output is required it can be defined here (otherwise it can just be equal to output) * @param dim - the dimension to compute the inverse FFT in * @return - true if successful, false if the dimensions of input and output are not compatible, i.e. not supported by the edu_mines_jtk 1d fft */ final public static < C extends ComplexType< C >, R extends RealType< R > > boolean complexToReal( final RandomAccessibleInterval< C > input, final RandomAccessibleInterval< R > output, final Interval interval, final int dim ) { return complexToReal( input, output, interval, dim, true ); }
/** * Computes a real-to-complex forward FFT transform of an n-dimensional dataset in a certain dimension (typically dim = 0). * By default as many threads as processors are available are used. * By default the complex values are not scaled (not divided by the amount of pixels in the input dataset) * * @param input - the real-valued input dataset * @param output - the complex-valued output dataset * @param interval - if just a subset of the complex-valued output is required it can be defined here (otherwise it can just be equal to output) * @param dim - the dimension to compute the FFT in * @return - true if successful, false if the dimensions of input and output are not compatible, i.e. not supported by the edu_mines_jtk 1d fft */ final public static < R extends RealType< R >, C extends ComplexType< C > > boolean realToComplex( final RandomAccessibleInterval< R > input, final RandomAccessibleInterval< C > output, final Interval interval, final int dim ) { return realToComplex( input, output, dim, false ); }
final public static < C extends ComplexType< C >, R extends RealType< R > > Img< R > complexToReal( final RandomAccessible< C > input, final Interval inputInterval, final ImgFactory< R > factory, final R type, final ExecutorService service ) { return complexToReal( input, inputInterval, null, factory, type, service ); }
final public static < C extends ComplexType< C >, R extends RealType< R > > Img< R > complexToReal( final RandomAccessible< C > input, Interval inputInterval, final ImgFactory< R > factory, final R type ) { return complexToReal( input, inputInterval, null, factory, type ); }
final public static < C extends ComplexType< C >, R extends RealType< R > > Img< R > complexToReal( final RandomAccessibleInterval< C > input, final ImgFactory< R > factory, final R type ) { return complexToReal( input, input, null, factory, type ); }
final public static < C extends ComplexType< C >, R extends RealType< R > > Img< R > complexToReal( final RandomAccessibleInterval< C > input, final Interval outputDimensions, final ImgFactory< R > factory, final R type, final int numThreads ) { return complexToReal( input, input, outputDimensions, factory, type, numThreads ); }
final public static < C extends ComplexType< C >, R extends RealType< R > > Img< R > complexToReal( final RandomAccessibleInterval< C > input, final Interval outputDimensions, final ImgFactory< R > factory, final R type, final ExecutorService service ) { return complexToReal( input, input, outputDimensions, factory, type, service ); }
final public static < C extends ComplexType< C >, R extends RealType< R > > Img< R > complexToReal( final RandomAccessibleInterval< C > input, final Interval outputDimensions, final ImgFactory< R > factory, final R type ) { return complexToReal( input, input, outputDimensions, factory, type ); }