final public static < R extends RealType< R >, C extends ComplexType< C > > void realToComplex( final RandomAccessibleInterval< R > input, final RandomAccessibleInterval< C > output, final int numThreads ) { final ExecutorService service = Executors.newFixedThreadPool(numThreads); realToComplex(input, output, service); service.shutdown(); }
final public static < R extends RealType< R >, C extends ComplexType< C > > Img< C > realToComplex( final RandomAccessible< R > input, final Interval inputInterval, final ImgFactory< C > factory, final C type, final int numThreads ) { final ExecutorService service = Executors.newFixedThreadPool( numThreads ); final Img< C > ret = realToComplex( input, inputInterval, factory, type, service ); service.shutdown(); return ret; }
final public static < R extends RealType< R >, C extends ComplexType< C > > Img< C > realToComplex( final RandomAccessible< R > input, final Interval inputInterval, final ImgFactory< C > factory, final C type ) { return realToComplex( input, inputInterval, factory, type, Runtime.getRuntime().availableProcessors() ); }
final public static < R extends RealType< R >, C extends ComplexType< C > > void realToComplex( final RandomAccessibleInterval< R > input, final RandomAccessibleInterval< C > output ) { realToComplex( input, output, Runtime.getRuntime().availableProcessors() ); }
/** * @deprecated Use * {@link #realToComplex(RandomAccessible, Interval, ImgFactory, ExecutorService)} * instead. */ @Deprecated final public static < R extends RealType< R >, C extends ComplexType< C > > Img< C > realToComplex( final RandomAccessible< R > input, Interval inputInterval, final ImgFactory< C > factory, final C type, final ExecutorService service ) { return realToComplex( input, inputInterval, factory.imgFactory( type ), service ); }
public static < R extends RealType< R > > Img< ComplexFloatType > computeImgFFT( final Interval imgConvolutionInterval, final RandomAccessible< R > img, final ImgFactory< ComplexFloatType > fftFactory, final ExecutorService service ) { // assemble the correct kernel (size of the input + extended periodic + // top left at center of input kernel) final RandomAccessibleInterval< R > imgInput = Views.interval( img, imgConvolutionInterval ); // compute the FFT's return FFT.realToComplex( imgInput, fftFactory, service ); }
public static < R extends RealType< R > > Img< ComplexFloatType > computeImgFFT( final Interval imgConvolutionInterval, final RandomAccessible< R > img, final ImgFactory< ComplexFloatType > fftFactory, final ExecutorService service ) { // assemble the correct kernel (size of the input + extended periodic + // top left at center of input kernel) final RandomAccessibleInterval< R > imgInput = Views.interval( img, imgConvolutionInterval ); // compute the FFT's return FFT.realToComplex( imgInput, fftFactory, service ); }
final public static < R extends RealType< R > > Img< ComplexFloatType > realToComplex( final RandomAccessibleInterval< R > input, final OutOfBoundsFactory< R, RandomAccessibleInterval< R > > oobs, final ImgFactory< ComplexFloatType > factory ) { return realToComplex( Views.extend( input, oobs ), input, factory, new ComplexFloatType(), Runtime.getRuntime().availableProcessors() ); }
final public static < R extends RealType< R > > Img< ComplexFloatType > realToComplex( final RandomAccessibleInterval< R > input, final OutOfBoundsFactory< R, RandomAccessibleInterval< R > > oobs, final ImgFactory< ComplexFloatType > factory ) { return realToComplex( Views.extend( input, oobs ), input, factory, new ComplexFloatType() ); }
final public static < R extends RealType< R > > Img< ComplexFloatType > realToComplex( final RandomAccessibleInterval< R > input, final OutOfBoundsFactory< R, RandomAccessibleInterval< R > > oobs, final ImgFactory< ComplexFloatType > factory, final int numThreads ) { return realToComplex( Views.extend( input, oobs ), input, factory, new ComplexFloatType(), numThreads ); }
final public static < R extends RealType< R > > Img< ComplexFloatType > realToComplex( final RandomAccessibleInterval< R > input, final OutOfBoundsFactory< R, RandomAccessibleInterval< R > > oobs, final ImgFactory< ComplexFloatType > factory, final ExecutorService service ) { return realToComplex( Views.extend( input, oobs ), input, factory, new ComplexFloatType(), service ); }
final public static < R extends RealType< R > > Img< ComplexFloatType > realToComplex( final RandomAccessibleInterval< R > input, final ImgFactory< ComplexFloatType > factory ) { return realToComplex( Views.extendValue( input, Util.getTypeFromInterval( input ).createVariable() ), input, factory, new ComplexFloatType(), Runtime.getRuntime().availableProcessors() ); }
final public static < R extends RealType< R > > Img< ComplexFloatType > realToComplex( final RandomAccessibleInterval< R > input, final ImgFactory< ComplexFloatType > factory, final int numThreads ) { return realToComplex( Views.extendValue( input, Util.getTypeFromInterval( input ).createVariable() ), input, factory, new ComplexFloatType(), numThreads ); }
final public static < R extends RealType< R > > Img< ComplexFloatType > realToComplex( final RandomAccessibleInterval< R > input, final ImgFactory< ComplexFloatType > factory, final ExecutorService service ) { return realToComplex( Views.extendValue( input, Util.getTypeFromInterval( input ).createVariable() ), input, factory, new ComplexFloatType(), service ); }
final public static < R extends RealType< R > > Img< ComplexFloatType > realToComplex( final RandomAccessibleInterval< R > input, final ImgFactory< ComplexFloatType > factory ) { return realToComplex( Views.extendValue( input, Util.getTypeFromInterval( input ).createVariable() ), input, factory, new ComplexFloatType() ); }
public static < R extends RealType< R > > Img< ComplexFloatType > computeKernelFFT( final Interval kernelConvolutionInterval, final long[] min, final long[] max, final boolean complexConjugate, final RandomAccessible< R > kernel, final ImgFactory< ComplexFloatType > fftFactory, final ExecutorService service ) { // assemble the correct kernel (size of the input + extended periodic + // top left at center of input kernel) final RandomAccessibleInterval< R > kernelInput = Views.interval( Views.extendPeriodic( Views.interval( kernel, kernelConvolutionInterval ) ), new FinalInterval( min, max ) ); final Img< ComplexFloatType > fftKernel = FFT.realToComplex( kernelInput, fftFactory, service ); // if complexConjugate is set we are computing the correlation // instead of the convolution (same as mirroring the kernel) // should be false by default if ( complexConjugate ) FFTMethods.complexConjugate( fftKernel ); return fftKernel; }
public static < R extends RealType< R > > Img< ComplexFloatType > computeKernelFFT( final Interval kernelConvolutionInterval, final long[] min, final long[] max, final boolean complexConjugate, final RandomAccessible< R > kernel, final ImgFactory< ComplexFloatType > fftFactory, final ExecutorService service ) { // assemble the correct kernel (size of the input + extended periodic + // top left at center of input kernel) final RandomAccessibleInterval< R > kernelInput = Views.interval( Views.extendPeriodic( Views.interval( kernel, kernelConvolutionInterval ) ), new FinalInterval( min, max ) ); final Img< ComplexFloatType > fftKernel = FFT.realToComplex( kernelInput, fftFactory, service ); // if complexConjugate is set we are computing the correlation // instead of the convolution (same as mirroring the kernel) // should be false by default if ( complexConjugate ) FFTMethods.complexConjugate( fftKernel ); return fftKernel; }
final public static < R extends RealType< R >, C extends ComplexType< C > > Img< C > realToComplex( final RandomAccessible< R > input, Interval inputInterval, final ImgFactory< C > factory, final C type ) { // compute the size of the complex-valued output and the required padding final long[] paddedDimensions = new long[ input.numDimensions() ]; final long[] fftDimensions = new long[ input.numDimensions() ]; FFTMethods.dimensionsRealToComplexFast( inputInterval, paddedDimensions, fftDimensions ); // create the output Img final Img< C > fft = factory.create( fftDimensions, type ); // if the input size is not the right size adjust the interval if ( !FFTMethods.dimensionsEqual( inputInterval, paddedDimensions ) ) inputInterval = FFTMethods.paddingIntervalCentered( inputInterval, FinalDimensions.wrap( paddedDimensions ) ); // real-to-complex fft realToComplex( Views.interval( input, inputInterval ), fft ); return fft; }
final public static < R extends RealType< R >, C extends ComplexType< C > > Img< C > realToComplex( final RandomAccessible< R > input, Interval inputInterval, final ImgFactory< C > factory, final ExecutorService service ) { // compute the size of the complex-valued output and the required // padding final long[] paddedDimensions = new long[ input.numDimensions() ]; final long[] fftDimensions = new long[ input.numDimensions() ]; FFTMethods.dimensionsRealToComplexFast( inputInterval, paddedDimensions, fftDimensions ); // create the output Img final Img< C > fft = factory.create( fftDimensions ); // if the input size is not the right size adjust the interval if ( !FFTMethods.dimensionsEqual( inputInterval, paddedDimensions ) ) inputInterval = FFTMethods.paddingIntervalCentered( inputInterval, FinalDimensions.wrap( paddedDimensions ) ); // real-to-complex fft realToComplex( Views.interval( input, inputInterval ), fft, service ); return fft; }
final Img<ComplexFloatType> fftImg = FFT.realToComplex( imgInput, factory ); final Img<ComplexFloatType> fftKernel = FFT.realToComplex( kernelInput, factory );