# Fourier transform of 2D point spread function using Fiji

**URL:** <https://forum.microlist.org/t/fourier-transform-of-2d-point-spread-function-using-fiji/2038>\
**Category:** Theory\
**Created:** [January 18, 2023, 3:15am UTC](https://forum.microlist.org/t/fourier-transform-of-2d-point-spread-function-using-fiji/2038 "2023-01-18T03:15:07Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![szh141](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.microlist.org/szh141/32/1110_2.png) [@szh141](https://forum.microlist.org/u/szh141)\
**Post date:** [January 18, 2023, 3:15am UTC](https://forum.microlist.org/t/fourier-transform-of-2d-point-spread-function-using-fiji/2038/1 "2023-01-18T03:15:07Z")

</div>

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!

 ![Screen Shot 2023-01-17 at 10.14.08 PM](https://us1.discourse-cdn.com/flex020/uploads/microlist/original/2X/d/d4bcdac7ab08b47c9c407e94100c5e37eb59eb41.png)

---

<div class="post-metadata">

**Author:** ![P\_Tadrous](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.microlist.org/p_tadrous/32/862_2.png) [@P\_Tadrous](https://forum.microlist.org/u/P_Tadrous)\
**Post date:** [January 19, 2023, 11:55am UTC](https://forum.microlist.org/t/fourier-transform-of-2d-point-spread-function-using-fiji/2038/2 "2023-01-19T11:55:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![talley](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.microlist.org/talley/32/3_2.png) [@talley](https://forum.microlist.org/u/talley)\
**Post date:** [January 19, 2023, 12:14pm UTC](https://forum.microlist.org/t/fourier-transform-of-2d-point-spread-function-using-fiji/2038/3 "2023-01-19T12:14:32Z")

</div>

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](https://scikit-image.org/docs/stable/auto_examples/filters/plot_window.html)

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)

---

<div class="post-metadata">

**Author:** ![talley](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.microlist.org/talley/32/3_2.png) [@talley](https://forum.microlist.org/u/talley)\
**Post date:** [January 19, 2023, 12:16pm UTC](https://forum.microlist.org/t/fourier-transform-of-2d-point-spread-function-using-fiji/2038/4 "2023-01-19T12:16:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![szh141](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.microlist.org/szh141/32/1110_2.png) [@szh141](https://forum.microlist.org/u/szh141)\
**Post date:** [January 20, 2023, 2:49am UTC](https://forum.microlist.org/t/fourier-transform-of-2d-point-spread-function-using-fiji/2038/5 "2023-01-20T02:49:39Z")

</div>

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

 ![2DPSF](https://us1.discourse-cdn.com/flex020/uploads/microlist/original/2X/f/fcf2f31eadfba3acb722e66599dd76b82ed5d9ae.jpeg)

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

---

<div class="post-metadata">

**Author:** ![talley](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.microlist.org/talley/32/3_2.png) [@talley](https://forum.microlist.org/u/talley)\
**Post date:** [January 20, 2023, 2:20pm UTC](https://forum.microlist.org/t/fourier-transform-of-2d-point-spread-function-using-fiji/2038/6 "2023-01-20T14:20:06Z")

</div>

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:

 ![Screen Shot 2023-01-20 at 9.12.15 AM](https://us1.discourse-cdn.com/flex020/uploads/microlist/original/2X/0/0f4b33bc305b4bcaaf047bd6b0166d009f9cfb21.png)

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:

 ![Screen Shot 2023-01-20 at 9.15.56 AM](https://us1.discourse-cdn.com/flex020/uploads/microlist/original/2X/5/5f623a12aecff2fc093aa5fe5514afe05fcddaae.png)

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

![2DPSF-1_FFT](https://us1.discourse-cdn.com/flex020/uploads/microlist/original/2X/2/24e1448066c1eeb8d05aaa9282c673f7ddb04d4f.png)

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

---

<div class="post-metadata">

**Author:** ![talley](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.microlist.org/talley/32/3_2.png) [@talley](https://forum.microlist.org/u/talley)\
**Post date:** [January 20, 2023, 2:23pm UTC](https://forum.microlist.org/t/fourier-transform-of-2d-point-spread-function-using-fiji/2038/7 "2023-01-20T14:23:17Z")

</div>

> [@szh141](#):
>
> I google searched the attached 1st image, import it into Fiji

if you want better starting material for a simulated PSF, you should generate it yourself using something like: [BIG&nbsp;•&nbsp;PSF&nbsp;Generator](http://bigwww.epfl.ch/algorithms/psfgenerator/)

---

<div class="post-metadata">

**Author:** ![P\_Tadrous](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.microlist.org/p_tadrous/32/862_2.png) [@P\_Tadrous](https://forum.microlist.org/u/P_Tadrous)\
**Post date:** [January 20, 2023, 2:34pm UTC](https://forum.microlist.org/t/fourier-transform-of-2d-point-spread-function-using-fiji/2038/8 "2023-01-20T14:34:06Z")

</div>

![PSFResult](https://us1.discourse-cdn.com/flex020/uploads/microlist/original/2X/a/abe251809284bc8fc247502d8813644f20d48d59.jpeg) 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:

> **[Digital Image Processing](http://www.optarc.co.uk/bialith/)**
>
> Bialith scientific image processing, restoration and analysis software is free for non-commercial use. Deconvolution, measurement, 3D volumetric visualsation, automated registration, enhancement and batch processing are just some of the features....

---

<div class="post-metadata">

**Author:** ![szh141](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.microlist.org/szh141/32/1110_2.png) [@szh141](https://forum.microlist.org/u/szh141)\
**Post date:** [January 21, 2023, 2:58am UTC](https://forum.microlist.org/t/fourier-transform-of-2d-point-spread-function-using-fiji/2038/9 "2023-01-21T02:58:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ankit\_singh\_rawat](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.microlist.org/ankit_singh_rawat/32/1243_2.png) [@Ankit\_singh\_rawat](https://forum.microlist.org/u/Ankit_singh_rawat)\
**Post date:** [July 25, 2023, 2:17pm UTC](https://forum.microlist.org/t/fourier-transform-of-2d-point-spread-function-using-fiji/2038/10 "2023-07-25T14:17:21Z")

</div>

Hi @talley , Hope you are doing well.

I also need some help with PSF image processing and deconvolution. can I have your email address to discuss my problem.

Best Regards  
Ankit

---

<div class="post-metadata">

**Author:** ![talley](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.microlist.org/talley/32/3_2.png) [@talley](https://forum.microlist.org/u/talley)\
**Post date:** [July 25, 2023, 3:46pm UTC](https://forum.microlist.org/t/fourier-transform-of-2d-point-spread-function-using-fiji/2038/11 "2023-07-25T15:46:50Z")

</div>

> [@Ankit\_singh\_rawat](#):
>
> can I have your email address to discuss my problem.

Hi @Ankit_singh_rawat and welcome to the community. I would greatly prefer to answer questions here on the forum, and not via email, so that others can benefit from the answers and the discussions. Also, there may be other people here who are better suited to answer your questions and they will also see your questions. Please start a new thread with your question 🙂

---

<div class="post-metadata">

**Author:** ![Ankit\_singh\_rawat](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.microlist.org/ankit_singh_rawat/32/1243_2.png) [@Ankit\_singh\_rawat](https://forum.microlist.org/u/Ankit_singh_rawat)\
**Post date:** [July 26, 2023, 3:24am UTC](https://forum.microlist.org/t/fourier-transform-of-2d-point-spread-function-using-fiji/2038/12 "2023-07-26T03:24:13Z")

</div>

Hi Talley

Thanks for your response.

I just created a new topic. Hope to hear from you soon.

[https://forum.microlist.org/t/2d-fourier-transform-of-interferometric-images/2221](https://forum.microlist.org/t/2d-fourier-transform-of-interferometric-images/2221)

Best Regards  
Ankit

---

<div class="post-metadata">

**Author:** ![Ankit\_singh\_rawat](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.microlist.org/ankit_singh_rawat/32/1243_2.png) [@Ankit\_singh\_rawat](https://forum.microlist.org/u/Ankit_singh_rawat)\
**Post date:** [July 27, 2023, 7:59am UTC](https://forum.microlist.org/t/fourier-transform-of-2d-point-spread-function-using-fiji/2038/13 "2023-07-27T07:59:37Z")

</div>

Hi @talley

I am unable to use SIMCHECK plugin in fiji, I put .jar file in plugin folder, but I don’t see it when I run fiji

---

<div class="post-metadata">

**Author:** ![talley](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.microlist.org/talley/32/3_2.png) [@talley](https://forum.microlist.org/u/talley)\
**Post date:** [July 28, 2023, 10:59am UTC](https://forum.microlist.org/t/fourier-transform-of-2d-point-spread-function-using-fiji/2038/14 "2023-07-28T10:59:43Z")

</div>

the best place for Fiji help is really over at [forum.image.sc](https://forum.image.sc)

but in general, you’re better off installing plugins through the built-in plugin installer rather than manually downloading jar files and putting in the plugin folder

> **[Plugins](https://imagej.net/plugins/#installing-plugins)**
>
> The ImageJ wiki is a community-edited knowledge base on topics relating to ImageJ, a public domain program for processing and analyzing scientific images, and its ecosystem of derivatives and variants, including ImageJ2, Fiji, and others.

---

<div class="post-metadata">

**Author:** ![Ankit\_singh\_rawat](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.microlist.org/ankit_singh_rawat/32/1243_2.png) [@Ankit\_singh\_rawat](https://forum.microlist.org/u/Ankit_singh_rawat)\
**Post date:** [July 28, 2023, 12:23pm UTC](https://forum.microlist.org/t/fourier-transform-of-2d-point-spread-function-using-fiji/2038/15 "2023-07-28T12:23:59Z")

</div>

Hi Talley

Thanks for your reply.

I successfully installed the plugin but still am unable to see how windowing will improve the edge artifact, my Fourier transformed image still looks the same.

Best Regards  
Ankit
