[Insight-users] Forward + Inverse FFT != Identity transform

group at spellgen.com group at spellgen.com
Fri Jun 3 15:36:50 EDT 2005


Trying to debug a convolution routine for two images based on Fourier
transforms, I find that a forward FFT immediately followed by its inverse does
not produce the image I started with. The code looks straightforward enough -
it does the following:
1. Read the image from a grayscale char-type file
2. Resample to width and height both being powers of two.
3. Forward transform (float)
4. Another forward transform.
5. Flip data in both dimensions
6. Rescale to bring it into char range again
7 Write the image.

urls for the input (black with a white dot at the origin) and the output
images:
http://neuromagnetics.mc.vanderbilt.edu/out/itk/point.png
http://neuromagnetics.mc.vanderbilt.edu/out/itk/out.png

The source code is there as well:
http://neuromagnetics.mc.vanderbilt.edu/out/itk/four2-example.cxx

Any suggestions as to what is going on would be appreciated...

Cheers,

Stefan





More information about the Insight-users mailing list