[Insight-users] FFT 1D
Luis Ibanez
luis.ibanez at kitware.com
Wed May 16 15:05:05 EDT 2007
Hi Herve,
That's a very inefficient way of doing a 1D FFT of your 2D Image.
You could rather enjoy the "power of Open Source" and
look at the internal code of
itkVnlFFTRealToComplexConjugateImageFilter.txx
Instead of using the full itkVnlFFTRealToComplexConjugateImageFilter
you can simply invoke the VNL function that computes the 1D FFT
in lines 117-118:
vnl_fft_1d<TPixel> v1d(vec_size);
v1d.fwd_transform(signal);
If you use your current LineIterator in order to copy the pixels
from one row of the image into the "signal" array, you can then
invoke vnl_fft_1d to compute the FFT and put the resulting array
somewhere in the output image.
Now...
about your second problem,...
If you are going to take the first 1D FFT and then run another
1D FFT in the orthogonal direction... then.. what you are doing
is to compute the 2D FFT of the original image anyways.
In that case you simply need to use the
itkVnlFFTRealToComplexConjugateImageFilter
or if you can install FFTW in your machine, you
can also use:
itkFFTWRealToComplexConjugateImageFilter
You may want to use at the examples:
FFTDirectInverse.cxx
FFTDirectInverse2.cxx
FFTImageFilter.cxx
FFTImageFilterFourierDomainFiltering.cxx
In the directory :
Insight/Examples/Filtering
and their corresponding description in the ITK
Software Guide:
http://www.itk.org/ItkSoftwareGuide.pdf
Regards,
Luis
--------------------
herve chloe wrote:
> Hi,
>
> I’m a new user of the ITK.
> I would like to perform a FFT 1D of a 2D image, namely I want to compute
> FFT1D on each line of the 2D image.
>
> In that purpose, I am trying to select a region, in fact just a line of
> the 2D image using either itkImageLinearIteratorWithIndex either
> itkImageRegionIteratorWithIndex either itkImageRegionIterator. Then I
> compute the FFT2D with itkVnlFFTRealToComplexConjugateImageFilter of
> this region next I copy this result in a new image which I have been
> previously allocated. I do the same procedure for all the lines.
> Is this a good process?
>
> I have 2 pb : the first is that it doesn’t work and the second is that
> as the FFT2D is shared in two major parts, the first consist in
> performing a FFT1D in one direction and the second is a FFT1D in the
> orthogonal direction performed on the result of the first part.
> Can I just stop to the first part?
>
> Sorry for my poor English, I hope you will understand my message.
> Any help would be very precious.
> Thank you very much
>
> _________________________________________________________________
> Découvrez le Blog heroic Fantaisy d'Eragon!
> http://eragon-heroic-fantasy.spaces.live.com/
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
More information about the Insight-users
mailing list