FFT of image stack

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

FFT of image stack

Henny Zandbergen
Is there a plugin that can
1. calculate the FFT of each frame of a movie and
2. create of this stack of FFT's a new movie?   (preferable only
amplitude (so only real part))
henny

--
--------------------------------
Henny Zandbergen, tel 31-15-2782266, fax 31-15-2786730
Reply | Threaded
Open this post in threaded view
|

Re: FFT of image stack

Gabriel Landini
On Saturday 05 December 2009, you wrote:
> Is there a plugin that can
> 1. calculate the FFT of each frame of a movie and
> 2. create of this stack of FFT's a new movie?   (preferable only
> amplitude (so only real part))

You could do it with a macro, something like:

a=getTitle(); // your stack
for(i=1;i<=nSlices;i++){
 setSlice(i);
 run("FFT");
 selectImage(a);
}
run("Images to Stack", "name=Stack title=[FFT of] use");

You might have to change the FFT options to get only the real part, but I
think that real and imaginary parts are returned as a 2 slice stack, so there
might be more modifications to do to the above.

Cheers

G.
Reply | Threaded
Open this post in threaded view
|

Re: FFT of image stack

Wayne Rasband
In reply to this post by Henny Zandbergen
On Dec 5, 2009, at 8:23 AM, Henny Zandbergen wrote:

> Is there a plugin that can
> 1. calculate the FFT of each frame of a movie and
> 2. create of this stack of FFT's a new movie?   (preferable only
> amplitude (so only real part))
> henny

Here is a macro that creates an FFT power spectrum movie.

    setBatchMode(true);
    stack = getImageID;
    newImage("FFT Movie of "+getTitle, "8-bit", getWidth, getHeight,  
nSlices);
    movie = getImageID;
    for (i=1; i<=nSlices; i++) {
       showProgress(i, nSlices);
       selectImage(stack);
       setSlice(i);
       run("FFT");
       run("Copy");
       close;
       selectImage(movie);
       setSlice(i);
       run("Paste");
    }
    setBatchMode(false);

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: FFT of image stack

Henny Zandbergen
Works perfectly. Saving the movie as avi gives only the amplitude.


>On Dec 5, 2009, at 8:23 AM, Henny Zandbergen wrote:
>
>>Is there a plugin that can
>>1. calculate the FFT of each frame of a movie and
>>2. create of this stack of FFT's a new movie?   (preferable only
>>amplitude (so only real part))
>>henny
>
>Here is a macro that creates an FFT power spectrum movie.
>
>    setBatchMode(true);
>    stack = getImageID;
>    newImage("FFT Movie of "+getTitle, "8-bit", getWidth, getHeight, nSlices);
>    movie = getImageID;
>    for (i=1; i<=nSlices; i++) {
>       showProgress(i, nSlices);
>       selectImage(stack);
>       setSlice(i);
>       run("FFT");
>       run("Copy");
>       close;
>       selectImage(movie);
>       setSlice(i);
>       run("Paste");
>    }
>    setBatchMode(false);
>
>-wayne

--
--------------------------------
Henny Zandbergen, tel 31-15-2782266, fax 31-15-2786730
Reply | Threaded
Open this post in threaded view
|

the sum of a stack

Henny Zandbergen
In reply to this post by Wayne Rasband
I would like to take the sum of all the images in a movie (movie is
stack of Fourier transforms (amplitide only))
Is there a macro for this?
henny




>On Dec 5, 2009, at 8:23 AM, Henny Zandbergen wrote:
>
>>Is there a plugin that can
>>1. calculate the FFT of each frame of a movie and
>>2. create of this stack of FFT's a new movie?   (preferable only
>>amplitude (so only real part))
>>henny
>
>Here is a macro that creates an FFT power spectrum movie.
>
>    setBatchMode(true);
>    stack = getImageID;
>    newImage("FFT Movie of "+getTitle, "8-bit", getWidth, getHeight, nSlices);
>    movie = getImageID;
>    for (i=1; i<=nSlices; i++) {
>       showProgress(i, nSlices);
>       selectImage(stack);
>       setSlice(i);
>       run("FFT");
>       run("Copy");
>       close;
>       selectImage(movie);
>       setSlice(i);
>       run("Paste");
>    }
>    setBatchMode(false);
>
>-wayne

--
--------------------------------
Henny Zandbergen, tel 31-15-2782266, fax 31-15-2786730
Reply | Threaded
Open this post in threaded view
|

Re: the sum of a stack

Wayne Rasband
On Dec 5, 2009, at 10:09 AM, Henny Zandbergen wrote:

> I would like to take the sum of all the images in a movie
> (movie is stack of Fourier transforms (amplitide only))
> Is there a macro for this?
> henny

You can sum all the images in a stack by using the Image>Stacks>Z  
Project command and selecting the "Sum Slices" option in the dialog box.

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: the sum of a stack

Gluender-3
In reply to this post by Henny Zandbergen
Dear,

you might have a look at the IJ-manual:

<http://rsb.info.nih.gov/ij/docs/menus/image.html#stacks>

Most probable you won't need a macro...

>I would like to take the sum of all the images in a movie (movie is
>stack of Fourier transforms (amplitide only))
>Is there a macro for this?
>henny

HTH
--

                   Herbie

          ------------------------
          <http://www.gluender.de>