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

Jordi Inglada jordi.inglada at cnes.fr
Wed Jul 6 12:02:43 EDT 2005


Julien,

Thanks for your answer.

Julien Jomier wrote:

> Jordi, Stefan,
>
> We had the same issue here. One solution was to use FFTW and the
> corresponding FFTW classes in ITK.
>

I have just tried, but now is FFTW (version 3) which causes trouble. 
First of all I had to add the following lines to 
itkFFTWRealToComplexConjugateImageFilter.h in order to compile with gcc 
3.4 :

 typedef typename Superclass::TInputImageType TInputImageType;
  typedef typename Superclass::TOutputImageType TOutputImageType;

And now, the the fftwf_* functions seem not to be present into the 
libfftw3.a file (at least, ld is no able to find them and 'nm libfftw3.a 
|grep fftwf' says nothing).

> We didn't have time to dig into the possible bug using the VNL classes.
> Did you submit a bug report on the bug tracker (www.itk.org/bug) yet?
>

Not yet.

Jordi

> Julien
>
> Jordi Inglada wrote:
> > Dear Stefan, all,
> >
> > Has there been a proposed solution to this problem? We are having
> > similar problems : the FFT of a sinusoidal surface has not the expected
> > shape (see the real, imaginary, and module parts of the FFT). We have
> > used the FFTImageFilter.cxx example.
> >
> > Thanks for any advice.
> >
> > J. Inglada
> >
> > group at spellgen.com wrote:
> >
> >> 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
> >>
> >>
> >>
> >> _______________________________________________
> >> Insight-users mailing list
> >> Insight-users at itk.org
> >> http://www.itk.org/mailman/listinfo/insight-users
> >>
> >
> >
> >
> > 
> ------------------------------------------------------------------------
> >
> >
> > 
> ------------------------------------------------------------------------
> >
> >
> > 
> ------------------------------------------------------------------------
> >
> >
> > 
> ------------------------------------------------------------------------
> >
> >
> > 
> ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
>


-- 
CNES - DCT/SI/AP - BPI 1219
18, avenue Edouard Belin
31401 Toulouse Cedex 09 - France
Tel. +33.(0)5.61.27.33.97 - Fax. +33.(0)5.61.28.31.09 



More information about the Insight-users mailing list