Fourier transform of 2D point spread function using Fiji

Hello all,

I was trying to use Fiji’s FFT to get an MTF curve out of a 2D image of a point spread function. I google searched the attached 1st image, import it into Fiji, split its RGB into single color, process the green channel using FFT function in the Fiji. The 2nd image below is the FFT image.

My question is that why the FFT has vertical lines when the original image is perfectly symmetrical. Shouldn’t it have similar patterns in the horizontal direction? Also, why is the repeating walnut structure on the horizontal line? If I draw a line across the central walnut on the horizontal direction, I will expect something like the 3rd image below. Maybe that’s true, but where are all the repeating, deteriorating walnut structures coming from? Please help me out and shed some light on this issue. Thank you!

Please post the original input image to your FIJI effort - i.e. the green channel image you separated out or a link to the Google image.
Also, you may get more responses to this if you post in the image.sc forum rather than the microforum since the questions is more directly related to FIJI image processing.

1 Like

Yeah need to see the original image to give you a full answer.

Long story short, you’ll likely need to apply a window function to the image before the FFT to avoid the edge artifacts causing the vertical/horizontal patterns. Google “FFT windowing” and you’ll find a ton of stuff, and see these docs for a brief intro: Using window functions with images — skimage v0.19.2 docs

Also, you’ll very likely need to pad the windowed image with zeros to a larger size to get the full OTF/MTF (the extent of Fourier space you get in the FFT depends on the size of the input image)

1 Like

by the way, the simcheck plugin in Fiji has a nice one-step FFT that applies a window for you before doing the FFT… I tend to use that (rather than manually creating and applying my own window) when I want a nice FFT without the edge artifacts

Thank you all for the reply. Attached please find the original image.

Yes, I was reading about the window function. That’s really helpful.

did you actually use this JPG image for the fft? If so, that’s another part of your problem. It has been resampled (it no longer retains the “original” pixels that would have resulted from a real image) … and has all kinds of resampling artifact. Note that an FFT is extremely sensitive to this sort of thing.

if you zoom way in you’ll see that the “apparent” pixels are actually much larger than the real pixels:

so, that’s where you’re getting all those walnut structures from (it’s aliasing of a sort).

if i dramatically downsize your image to something like 128x128, you at least get an approximately radially symmetric FFT:

… and if i then apply a windowing function before doing the FFT, you get something without the vert/horizontal lines:

2DPSF-1_FFT

The remaining “double ring” bit there (the fact it has a minimum followed by another outer ring) is likely due to my downsizing (where I just guessed at the number of original pixels).

So, to summarize:

  1. you need to start with an image of a PSF that has “real” sampling. Not a jpeg, not an image that has been upsized and interpolated to have more pixels than the original image or simulated PSF.
  2. you need to apply a windowing function if you want to avoid the vertical/horizontal edge artifacts
1 Like

if you want better starting material for a simulated PSF, you should generate it yourself using something like: BIG • PSF Generator

Hello. I also analysed this at the same time at @talley so please excuse the duplication but there are a couple of other points.
Short answer:

  1. There is a strong white line of pixels (actually a couple) at the very bottom of the frame of your original so this explains the dominant verticals in the centre of your FFT.
  2. The compound pixels with upscaling artefact explain the walnuts.

Longer answer:
I found that FIJI did not give a clear FFT of all the issues here and not sure why so I used my own BiaQIm Image Processing Suite (BIPS) for the rest of the processing. See the difference between the two in the top row of the figure.
If you crop the bottom bright lines off the original you get a much clearer picture of the compound pixel artefact (middle row left). If you isolate the walnuts in the Fourier fomain and back-transform you can see the compound pixel boundaries they represent very clearly (bottom left).
Finally, as the compound pixels are 8x8 true pixels, if you do 2x2 binning three times you get down to the ‘original’ resolution and FFT of that gives you the expected transfer function (bottom right).

It appears that this ‘original’ was a compressed screen grab from someone who blew up an image of a PSF and captured part of the GUI window in the bottom of the image (the bright lines).

You can generate PSFs with programs in the BIPS if you want to play with synthetic PSFs in addition to what has already been said. See:

1 Like

Excellent points. Thank you both for taking the time solving this puzzle for me. Cannot wait to give it a try on your softwares.