[Insight-users] VNLFFT vs. FFTW

Cory Quammen cquammen at cs.unc.edu
Wed Aug 3 16:59:27 EDT 2011


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

On Wed, Aug 3, 2011 at 1:25 PM, Cory Quammen <cquammen at cs.unc.edu> wrote:
>
> Kevin,
>
> I've created an issue in the new ITK bug tracker here:
>
> https://itk.icts.uiowa.edu/jira/browse/ITK-270
>
> I've observed the doubling along the x-axis you report when using
> FFTW. I'm investigating now.
>
> Cory
>
> On Tue, Aug 2, 2011 at 10:41 AM, Kevin H. Hobbs <hobbsk at ohio.edu> wrote:
> > I'm doing
> >
> > 1.
> > read -> FFT -> FFTShift -> modulus -> log -> file1
> >
> > Using the file to make a mask and then doing:
> >
> > 2.
> > read_mask -> FFTShift
> >                     \
> >                      --> mask -> iFFT -> file2
> >                     /
> >          read -> FFT
> >
> > When I use FFTW I have to do UpdateLargestPossibleRegion() at the end of
> > 1. or the mask in 2. fails complaining about the regions being at least
> > partially outside.. well duh FFTW uses symmetry to only make half the
> > output. But then file2 gets doubled along the x-axis with vertical lines
> > of junk (I'm surprised it worked at all).
> >
> > I switched to using the VNL classes and all is well, I suppose I could
> > crop the masked image if I know that the iFFT is the FFTW class... but
> > that seems like a bit of a kludge.
> >
> > It should probably be a bug that a program writen with
> > itk::FFTRealToComplexConjugateImageFilter and
> > itk::FFTComplexConjugateToRealImageFilter will fail based on weather itk
> > was made with FFTW.
> >
> >
> > _____________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Kitware offers ITK Training Courses, for more information visit:
> > http://www.kitware.com/products/protraining.html
> >
> > Please keep messages on-topic and check the ITK FAQ at:
> > http://www.itk.org/Wiki/ITK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.itk.org/mailman/listinfo/insight-users
> >
> >
>
>
>
> --
> Cory Quammen
> Research Associate
> Department of Computer Science
> University of North Carolina at Chapel Hill
> http://www.cs.unc.edu/~cquammen
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users



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


More information about the Insight-users mailing list