[Insight-users] FFTWComplexConjugateToRealImageFilter gives output 2 times the size of input

Karthik Krishnan karthik.krishnan at kitware.com
Sat Oct 18 18:35:50 EDT 2008


On Sat, Oct 18, 2008 at 1:07 PM, Amit Mukherjee <mukhea at rpi.edu> wrote:
> Hi all,
>
> I was doing FFTW in ITK and I was using the following code for an input size
> [200, 200, 100] ..
>
>
> typedef float PixelType;
> typedef itk::Image< PixelType, 3 >      ImageType3D;
> typedef itk::FFTWComplexConjugateToRealImageFilter <PixelType, 3 >
> invFFTFilterType;
>
> invFFTFilterType::Pointer ifft = invFFTFilterType::New();
> ifft->SetInput(complexInput);
> ImageType3D::Pointer vols = ifft->GetOutput();
> vols->Update();
>
> In the above code "complexInput" is a [200, 200, 100]
> itk::Image<std::complex<float>,3> data obtained due to some operation. I
> just need the real part of the IFFT as output. But I observe that "vols" in
> the above code is of size [398, 200, 100] ...
>
> Any idea why the size is increasing and how the data (real and complex) is
> arranged within..

The inverse FFT filter assumes that the image you are supplying obeys
Hermetian symmetry. For the IFFT to yield a real image, the inputs to
it have to be hermetian symmetric (one half is a complex conjugate of the
other). So, the IFFT filter assumes that you are supplying just one
half. Hence you observe the output size doubling.

Similarly, if you've used the FFTRealToComplex filter in ITK, you'll
notice that the output is half the size of the input.



>
> Amit
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>



-- 
Karthik Krishnan
R&D Engineer,
Kitware Inc.
Ph: 518 371 3971 x119
Fax: 518 371 3971


More information about the Insight-users mailing list