[Insight-developers] FFT Filter Question Again -- Overwriting input image?
Kent Williams
norman-k-williams at uiowa . edu
17 Nov 2003 11:17:21 -0600
In some exchanges with the FFTW developers, they've indicated something
that I hadn't fully realized: If you do an Inverse Complex to Real FFT,
FFTW wants to use its input as scratch space, thereby destroying the
input image. I'm not sure, but I suspect a lot of FFT implementations do
the same thing.
But it seems like the standard behavior in an ITK pipeline is to leave a
filter's inputs intact; ImageToImage filter returns const InputImageType
from it's GetInput method.
So here's my question: Should I modify the filter to copy the input to a
scratch array, and work on that? Or is it sufficient to document that
the filter scrambles it's input image?
This seems like a place where the ITK pipeline pattern is at odds with
the normal way of working with FFTs. Most of the applications do the
forward and reverse transforms in place, meaning the forward transform
replaces its input with its complex result, and the inverse transform
overwrites it's complex input with the real results.