[Insight-users] VNLFFT vs. FFTW

Cory Quammen cquammen at cs.unc.edu
Thu Aug 18 02:47:03 EDT 2011


Okay, I think I've found the problem. There was an error in the
factory mechanism inside itk::FFTRealToComplexConjugateImageFilter
that caused VNL to always be used no matter what, regardless of
whether FFTW was enabled. This caused the output of
itk::FFTRealToComplexConjugateImageFilter to be the full Fourier
transform image rather than half. That explains why the output was
nearly doubled along the X-dimension when you took the inverse.

I have a patch on gerrit to which I've added you as a reviewer:

http://review.source.kitware.com/#change,2506

Could you evaluate the patch and see if it solves your problem?

Thanks,
Cory

On Fri, Aug 5, 2011 at 9:51 AM, Kevin H. Hobbs <hobbsk at ohio.edu> wrote:
> On 08/03/2011 04:59 PM, Cory Quammen wrote:
>> Kevin,
>>
>> What might be happening is a side-effect of FFTW returning an image
>> that is about half the image size in the first (x) dimension. The
>> problem is that itk::FFTRealToComplexConjugateImageFilter will produce
>> an output image of the same size if the input image has size N *or*
>> size N+1 in the x-dimension. Unfortunately, you have to tell
>> itk::FFTComplexConjugateToRealImageFilter whether the original real
>> image input for FFTRealToComplexConjugateImageFilter has an even or
>> odd size in the x-dimension using SetActualXDimensionIsOdd() for it to
>> compute the output size correctly. For VNL, you don't have to do this,
>> but with FFTW you do.
>>
>> Can you see if adding a call to SetActualXDimensionIsOdd() fixes some
>> of your problems?
>>
>> Thanks,
>> Cory
>>
>
> It does not. If I switch back to using the FFTW classes and add
> SetActualXDimensionIsOddOff I still get an output image that is twice
> the size of the original image.
>
> Just in case I'm doing something else stupid I'm including the source
> code for both the program I use to create the mask and the program to
> apply the mask.
>



-- 
Cory Quammen
Research Associate
Department of Computer Science
The University of North Carolina at Chapel Hill


More information about the Insight-users mailing list