[Insight-developers] Consistency in the output of forward/inverse FFT image filters

Padfield, Dirk R (GE Global Research) padfield at research.ge.com
Tue Sep 6 15:10:59 EDT 2011


Hi All,

I'm sorry for joining this conversation late; my email filter was tossing these emails aside before I could read them, but I think I have that fixed now :-)

I definitely agree that the outputs and inputs of the FFTW and VNL FFT calculations (and others?) should be specified the same way, whether it is as a full or half matrix.  But I am not convinced that the best choice should be the half matrix.  I think most users will expect and prefer to have the full matrix as the output and that they will be surprised and disappointed with the added complexity of having the half image and having to convert it back to a full image.  Although the half image preserves memory, it is far less intuitive.  The memory savings is only a factor of 2, which isn't that significant in most applications (from an order complexity perspective, it is independent of the image size).

One issue we have heard about ITK is that it is not simple enough to work with (hence the SimpleITK project), and I believe outputting the half matrix will be introducing additional complexity.  For example, the discussions about the FFTShiftImageFilter in this thread indicate that the full matrix is preferable.
 
If, however, we agree that the output should be the half matrix, I would prefer that we offer a mode that lets the user choose whether to output the full or half matrix. 
This way, those who really need the memory savings could choose to process their images with that mode.  

Does this make sense?

Dirk


-----Original Message-----
From: Gaëtan Lehmann [mailto:gaetan.lehmann at jouy.inra.fr] 
Sent: Friday, August 19, 2011 7:57 AM
To: Cory Quammen
Cc: Insight Developers; Padfield, Dirk R (GE Global Research); Kevin H. Hobbs
Subject: Re: Consistency in the output of forward/inverse FFT image filters


Le 18 août 11 à 21:14, Cory Quammen a écrit :

> Kevin Hobbs brought up a good point in a recent post to the ITK users 
> list regarding the output of the forward FFT filter. Right now, the 
> output of this filter is quite different if FFTW is enabled. This is 
> because FFTW computes only about half of the output image because of 
> the Hermitian symmetry inherent in the Fourier transform of a real 
> signal, while the FFT routine in VNL computes the full output image.
> Kevin pointed out that to effectively work with the output of this 
> filter, one must know whether the output is in the half or full image 
> format, and one must explicitly check in the code whether FFTW is 
> enabled to check that. I agree with him that this is undesirable.
>
> To make the FFT filters' behaviors consistent regardless of whether 
> FFTW is enabled, I propose that all FFT filters include an option to 
> produce the full output image. By default, all the FFT filters would 
> produce the half output (what FFTW produces). The inverse filters 
> would also have an option to specify whether their input is in the 
> half or full output format.
>
> Does this sound like a good idea? I'm happy to work on a patch for 
> this change if there are no objections.
>

Hi Cory,

It's a very good idea.

What would you think of adding a new filter to produce the full image from the half output of the fft filter instead of adding an option to the fft filter?
Also, would that behavior make sense when working on complex images?

Regards,

Gaëtan



--
Gaëtan Lehmann
Biologie du Développement et de la Reproduction INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://mima2.jouy.inra.fr  http://www.itk.org http://www.bepo.fr



More information about the Insight-developers mailing list