There are a couple of similar questions here and here.
Basically the output size of an FFT can be different than what you expect because the input to the FFT is sometimes padded to a “fast” size. The fast sizes can be different between different implementations. As well the FFT output is complex, however the FFT of a real signal is symmetric, so the redundant part of the FFT is sometimes discarded. Finally there is sometimes an additional padding factor added to the signal to prevent edge artifacts (in addition to padding to a fast size).
The library you are using FourierTransform is an older library that has been replaced by FFTMethods
Imagej-ops, wraps FFTMethods. I just tested the following script using the bridge (512 by 512) sample image.
# @OpService ops
# @UIService ui
# @Dataset img
from net.imglib2.img.display.imagej import ImageJFunctions
# display fft (by default it is displayed as power spectrum)
ImageJFunctions.show(fft).setTitle("fft power spectrum")
The output size is 281 by 560. This is because it was padded to a fast size, and the redundant complex values were eliminated. Your output size was different because
FourierTransform uses a slightly different padding strategy.
Note that imagej-ops is meant to be expandable such that many implementations of different algorithms can be implemented. Thus in the future other implementations (ImageJ1-Hartley, Parallel FFTJ, FFTW, cufft, etc.) may be wrapped.