[Insight-developers] FFT filters

Kent Williams norman-k-williams at uiowa . edu
Wed, 12 Nov 2003 09:08:22 -0600


1. I added a method to the FFT filters -- bool FullMatrix() which is 
true if the FFT code returns a full matrix from the FFT operation (like 
vnl) or just the 'half complex' result.  If I save the full result from 
VNL real-to-complex FFT, the inverse works.

2. I added a test to the VNL FFT class on the array size, based on what 
I found in another prime factor algorithm FFT.  It requires each array 
dimension to be of the form 2^p * 3^q * 5^r, for p, q, r > 0.  In 
medical imaging the common image sizes coming out of scanners will 
almost always satisfy this constraint.  If not, the input image should 
be enlarged or cropped.

3.  I added classes for the SGI  SCSL library.   To use them, set 
USE_SCSL to true.  I added a FindSCSL.cmake that knows where to find the 
library and headers on the SGIs we have.

4. There are tests included for FFTW and SCSL fft implementations, that 
will be compiled and run if you define USE_FFTW and USE_SCSL 
respectively.  USE_FFTW I would leave out for Linux boxes, because there 
are apparently GCC bugs that make the test fail for some versions of GCC.

If I personally needed FFT in an application I'd decide which 
implementation to use thusly:

1. If the application will be on SGI, exclusively, use SCSL.
2. If it doesn't matter if your code is 'GPL-infected', use FFTW, but 
I'd beware of the compiler issues with GCC.
3. Otherwise I'd use VNL, or make a new class based on another FFT code.

For as useful as FFT is in a variety of problem domains, the 
documentation always seems a bit sketchy to me.

Another side note: in my searching around, there are a LOT of 
GPL-licensed FFT libraries, and very few true public domain ones, unless 
you want to figure out the old FORTRAN codes like netlib.   And some 
people seem to be a little confused about what all this licensing stuff 
really means -- a common FFT code floating around is based on running 
old fortran code through f2c and slightly massaging it. Then the 
'author' slapped the GPL on it.