http://imagej.273.s1.nabble.com/Rephrased-FFT-Question-tp5007000p5007034.html
Not sure if this adds anything to the conversation at this point, but my open-source plugin distribution (
) has a fast temporal fft (it installs under Plugins>ICS Tools>stack temporal fft jru v1) which will calculate your fft much faster (around 5 seconds for 128x128x2048). The output is a bit difficult to interpret (alternating real and imaginary images with first positive and then negative frequencies) as has been discussed before. My plugin distribution also has tools for temporal and spatiotemporal correlation if you are interested in those approaches.
Rebecca - The list has answered your questions about implementing an FFT on your time-stacked data very nicely, but I wonder if an FFT is what you want. First, there's an implicit assumption that whatever is moving is following a stationary process - things are moving at a constant frequency across the entire time of your sample. If that's not true, you'll get destructive interferences in your interesting frequencies, and a loss of power in the frequencies. Second, there's the idea that your pixels are uncorrelated, so that an independent analysis of pixel i,j completes your information about that pixel without knowing what's happening in i,j+1.
I wonder what the list thinks? Would it be better to use a band-pass filter in the time dimension and fiddle with the band-pass parameters until the movement becomes apparent? Or something like an auto-correlation? Autoregressive moving average (ARMA) comes to mind. The computation is quick, and the information you get back is intuitive because the 2-d information is still in picture form. If you want to get fancy, you might start to think about correlations in all three dimensions, so that neighboring pixels get included in the picture. Just to be clear - these techniques relate strongly to the FFT, but they allow non-stationary signals to be analyzed.
Thanks to the list for the information about FFTJ. That was very useful to me.
> Yes, this macro is exactly the right thing, but it is really slow even
> when I make the stack 2^n (4096) images and bin it 4 x 4 x 2. (128 x
> 128 x 2048 total voxels.) I would think it could be much faster if
> implemented right, in java perhaps? I would guess that opening all
> those windows is unnecessary, but I am not sure how to *not* open
> them. But anyway, the results are pretty cool--any idea what frequency
> is represented by each image? Also, it's close to symmetrical over
> time--what's going on there, exactly (see attached)? I would think if
> it were symmetrical it would be largest in the center as well, but...
>
> Anyway, thanks for this start--I'll see what can be done,
>
> JPK
>
>
>
>
>
> On Thu, Mar 20, 2014 at 12:01 PM, Brian Northan <
[hidden email]> wrote:
>
>> Hi Rebecca
>>
>> I am not aware of a simple solution, hopefully someone else knows. But
>> someone had a similar problem a while back and it ended up being a
>> fairly involved discussion. He had to write some macros.
>>
>>
>>
http://imagej.1557.x6.nabble.com/Automating-Image-Processing-and-Prob>> lems-with-FFTJ-td5004660.html
>>
>> As Herbie mentioned FFTJ is not macro-recordable, I have a slightly
>> modified version of FFTJ which is recordable and is available here
>>
>>
https://github.com/bnorthan/RogueImageJPlugins/releases>>
>> It is really just a copy of the original except with the small
>> changes talked about in the other thread.
>>
>> I played around with calling FFTJ on individual points in a time
>> series using a python macro. I think the logic is right but keep in mind it is a
>> hack and pretty slow. The proper way to do it would be to perform all
>> calculations in one plugin. This approach loops through every pixel,
>> copies a time profile to a temp image then runs the plugin over and over.
>>
>>
>>
https://github.com/bnorthan/RogueImageJPlugins/blob/master/FFTJ_scrip>> table/macros/Time_Macro.py
>>
>>
>>
>>
>> On Thu, Mar 20, 2014 at 6:02 AM, Herbie <
[hidden email]> wrote:
>>
>>> Rebecca,
>>>
>>> if you manage to extract 1D-"images" from your time series of
>>> images, i.e. in fact pixel sequences as 1D-images, then you may use
>>> the FFTJ-PlugIn to perform 1D-FFTs of each of these series.
>>>
>>> <
http://rsb.info.nih.gov/ij/plugins/fftj.html>
>>>
>>> You may use a macro to extract the n^2 1D-images (assuming that your
>>> images are of size n x n). To make use of the FFT speed advantage,
>>> your stack must consist of m images (time slices), where m is a power of two.
>>>
>>> The problem with FFTJ is, that it isn't perfectly macro-recordable.
>>> It shows a dialog for choosing the result format. In other words, to
>>> fully automatize processing by an IJ-macro, you need to modify the
>>> source code
>> of
>>> FFTJ.
>>>
>>> HTH
>>>
>>> Herbie
>>>
>>> ::::::::::::::::::::::::::::::::::::::::
>>>
>>> On 20.03.14 02:04, Rebecca Keller wrote:
>>>
>>>> Thanks very much for this reference, but actually it is a bit
>>>> cumbersome to come in and out of imagej, since this "plugin"
>>>> requires ms excel for the fft'ing.
>>>>
>>>> Seems like it should be possible to get the current fft algorithm
>>>> to do a 1D FFT on each pixel over time, then re-output the
>>>> timelapse stack as a 2D image in frequency domain. Then it would be
>>>> neat, for example, to make a 2D image depth-coded by frequency. I,
>>>> however, just need to get the pixels which all have the same
>>>> frequencies, which should be easy enough to do using the 1D FFT
>>>> pixelwise which I suggested.
>>>>
>>>> JPK
>>>>
>>>> On Wed, Mar 19, 2014 at 5:18 PM, Eric Denarier <
>>>>
[hidden email]> wrote:
>>>>
>>>> Hi Rebecca, You may have a look to Claire Smith's CiliaFA macro. It
>>>>> reveals frequencies of intensity variation in different zone of a
>>>>> brightfield image. We are using it for high frequency Cilia
>>>>> beating. here is a link to the paper and macro :
>>>>>
http://www.ciliajournal.com/content/1/1/14>>>>>
>>>>>
>>>>> Rebecca Keller <
[hidden email]> a écrit :
>>>>>
>>>>> Dear List,
>>>>>
>>>>>>
>>>>>> Let me rephrase: what I am trying to do is locate oscillations of
>>>>>> a certain frequency onto a 2D visual field, i.e., convert the
>>>>>> third dimension (time) of a time-lapse image series into
>>>>>> frequency space. Then I could scan through frequency space (the
>>>>>> new third dimension) to find groups of pixels with similar
>>>>>> oscillation frequencies.
>>>>>>
>>>>>> So I guess what would need to be done is a 1D FFT for each pixel.
>>>>>> Is there any way easily to do this with the current imagej tools?
>>>>>>
>>>>>> JPK
>>>>>>
>>>>>> -- ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>>>>>>
>>>>>>
>>>>> -- ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>>>>>
>>>>>
>>>> -- ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>>>>
>>>>
>>> --
>>> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>>>
>>
>> --
>> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>>
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html> <whole_stack_FFT.png>