[Insight-users] I have a problem With FFT in ITK

Brad King brad.king at kitware.com
Tue Jul 25 17:36:34 EDT 2006


Simon Warfield wrote:
> Luis Ibanez wrote:
>>
>> Hi Simon,
>>
>> We know that a problem exists at the level of using FFT filters
>> in ITK that are based on the VNL ones. However, we didn't get to
>> find the source of the problem.
>>
>> It may well be that the ITK FFT filters are missing some operation
>> that is required for the good use of the vnl FFT; or it may be an
>> actual bug in the VNL implementation.
>>
>> The observation is that when you take an image, computes its FFT
>> and then apply the inverse FFT, you don't recover the original
>> image. The returned image is structured in different blocks and
>> it has non-zero values in places where it should be zero.
>>
>> The simplest way to test this is with the examples:
>>
>>    Insight/Examples/Filtering/
>>                  FFTDirectInverse.cxx
>>                  FFTDirectInverse2.cxx
>>
>>
>> The first one uses VNL,
>> while the second one uses FFTW.
>>
>>
>> If you have any suggestions on what may be the source
>> of the problem we will be happy to give them a try.
> 
> I don't have an idea about what might be going wrong with the VNL FFT,
> but there is a bug in the CMake configuration file for FFTW.
> line 15 of
> InsightToolkit-2.8.1/CMake/FindFFTW.cmake
>  defines a boolean option for FFTW_INCLUDE_PATH.  This line should be
> deleted.
> The later FIND_PATH in the same file will allow the FFTW_INCLUDE_PATH to
> be set.

It just so happens that while converting vnl for thread safety I
recently reconverted the gpfa2f.c from the original fortran source.
This was the routine implementing FFT for vnl.  An ITK FFT test started
failing after the conversion.  After diving into the differences between
the two f2c-generated files I found a bug in the old version that had
been introduced by manual editing of the C code over the years in vxl.

Anyway I have now committed the fixed version of the routine and an
updated test image.  If you update to the latest CVS version it should
work.  However since I just committed huge changes to upgrade all of the
Utilities/vxl directory to the latest version of vxl you might want to
watch the dashboard for a few days before updating.

-Brad


More information about the Insight-users mailing list