A strange behaviour in jMRUI 7 after zero filling

Hi @JanaS,

I noticed a small bug in jMRUI 7. I load a dicom file, then do zero filling, then I zoom in the area near the peak. After that, the number of peaks increased.

I also noticed that, if I don’t do zero filling, then zoom in or zoom out is normal. I guess there’s something with zero filling.

In spite of the small bug, jMRUI is still a very helpful tool! Thanks for developing it!

  1. load the dicom file (only two peaks)
  2. add 1000 trailing zeros to FID
  3. Then zoom in (now there are four peaks?)
  4. When I adjust phasing, the magnitude changes accordingly (but it shouldn’t)

My platform is windows 10 with 32-bit JRE 1.8

This behavior also happened to other dicom files. I didn’t test other file types.

Dear Zui,
this is not necessarily a bug, adding zeros as a sample thickening tool will only work properly if the fid decays to zero at the tail. Could you please send me your dicom file? I would have a closer look at what the problem is.
Thank you
Jana
jana

Hi Jana,

I reproduced the baviour with a single peak file simulated in jMRUI (.mrui file type).
Open the file


zoom in

zero fliing of 1000 zeros

zoom out (initial view, then the strange peaks disappeared)

And it seems the real and imaginary parts are not affected by this strange behaviour. It’s just the magnitude. As you can see at the strange peak, the magnitude is zero while the real and imaginary parts are not zero.

adding zeros as a sample thickening tool will only work properly if the fid decays to zero at the tail

And a comment on this. I think zero filling will always work properly (i.e. improve the spectral resolution while not affecting anything else) even if FID does not decay to zero. The discrete time Fourier transform of signal x[n] of length N is a continuous function X(e^{jw}) defined on R with period 2pi. Whatfft in most programming languages does is sample N points of X(e^{jw}) from 0 to 2pi. And zero filling makes fft sample more points of X(e^{jw}) from 0 to 2pi. If we add infinite number of zeros to the tail, then result of fft will be identical to of X(e^{jw}) from 0 to 2pi.

Hi Zui
You are right there is a bug in the magnitude display. I was not able to repeat the problem until I discovered that this happens only when the FID is zero-filled using the “zero filling” button (the zero filling from the Preprocessing menu does not cause such a problem). I have fixed the bug. Thank you for reporting it.

PS: I was not probably precise in my wording “adding zeros as a sample thickening tool will only work properly if the FID decays to zero at the tail”. What I wanted to say was that, e.g., if a FID is cyclically shifted for correcting the group delay, the tail will not decay to zero and zero filling of such a FID may cause spectrum rippling. This happens because the correction points, originally present at the end of the time-domain signal, i.e. at very low negative times due to the time cyclicity, all of a sudden appear inside the signal. Similarly, rippling may be caused by FID truncation, which becomes visible in the spectrum because of the finer frequency sampling. You are right in saying that adding zeroes cannot change the FT in your continuous interpretation, but the new positions of the frequency samples may reveal the unpleasant wavy behaviour of the interpolation (kind of periodic sinc). But the true is that in your case, the problem was not related to spectrum rippling, but to wrong visualization of magnitude during zooming.

1 Like

Great! And thank you!

And now I know this strange behaviour can be circumvented by using zero-filling function from the preprocessing menu.