[ITK] [ITK-users] Metadata Information in FFT images can be misleading.

Matt McCormick matt.mccormick at kitware.com
Tue May 2 10:28:02 EDT 2017


On Mon, May 1, 2017 at 10:41 PM, Pablo Hernández <
pablo.hernandez.cerdan at outlook.com> wrote:

> Thanks Matt, I agree that the more appropriate thing to do would be to
> document better, but maybe only in the ForwardFFT filter instead of
> ImageBase?
>

Yes, ForwardFFTImageFilter is a good location, too.


I can imagine experiments where the input images are in the frequency
> domain: photo detectors in scattering ( from this search [1], these images
> [2] for example). In this case origin and spacing metadata make sense as
> they are, even though the experimenters know the physical units of the
> images are in hertz, not in meters.
>

Clarification and a good interface is also important for a common
application encountered in medical imaging: magnetic resonance imaging
collects samples in k-space.



> The problem with the metadata arises exclusively doing the FFT. If we
> modify it, we will lose the input image metadata. If we don't, the metadata
> of the output requires extra knowledge and read the documentation to be
> meaningful.
>
> Also the Origin is tricky... the first bin, or index {0}, of the output of
> an FFT depends on the frequency layout of the algorithm, usually in the
> "standard" layout, it corresponds to zero frequency [3]. So the
> Origin(Frequency) will be 0.0 if we understand the origin with the value of
> the first index..., but if the FFT is shifted, the first index would be now
> a large, negative frequency.
>
> In the ExternalModule, I am using a FrequencyIterator, derived from a
> regular ImageRegionIterator. It adds a GetFrequency() function, providing
> an abstraction to let the user stop worrying about the specifics of the
> frequency layout.
> There are 3 different layouts, Regular, FFTLayout, and ShiftedFFTLayout.
> - Regular is a normal iterator, with GetFrequency() calling Get(), for the
> case I commented when the image is taken in the frequency domain, but the
> user needs to use the IsotropicWavelet module on it (which requires
> frequency iterators).
> - FFTLayout is the standard FFT layout, vnl, fftw, and I think python uses
> it as well. This is the default type.
> - ShiftedFFTLayout, the layout after shifting the FFT.
>

> This allows to iterate an image from the frequency domain, and get the
> frequency value, the frequency bin, as well as actual value of the current
> pixel.
> And also they are a good place to store frequency 'metadata' information
> such as FrequencyOrigin, and FrequencySpacing, that depends on the
> frequency layout: See [4]
>

These iterators with the explicit methods are excellent! The naming makes
their meaning clear, and they are also practically useful for processing
FFT data. Great idea.


Cheers,
Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20170502/0341447b/attachment.html>
-------------- next part --------------
_____________________________________
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.php

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://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list