Obtaining amplitude, frequency and phase data off a FFT in ImageJ

I want to get the amplitude, phase and frequency at a point (yellow cross) on the FFT of the \mathbf\pi number drawing below:

I know now that there is a frequency of 3.63 \text{ pixels / cycle}, running across a diagonal line at 53.94^\circ, and the combined magnitude is probably part of the output on the menu bar: \vert X[k]\vert=\sqrt{X_\text{Re}^2+X_\text{Im}^2}= 119 (?).

To get the phase I need to get the complex plot, and calculate the \arctan\left(\frac{X_\text{Im}}{X_\text{Re}}\right).

So here we go… I get this additional Re/Im plot:

But now I have no idea where to place the yellow cross to make it correspond to the initial yellow cross above. Further, I don’t know if I have to get the x and y here, or on the real or imaginary plots:

I’m not sure if I understand what you’re trying to achieve.

Process > FFT > FFT creates an FFT image from the current image. You can then create a point selection and use Analyze > Measure M to get the R and Theta values in the Results window.

On a different FFT image, you can the use Edit > Selection > Restore Selection ShiftE to create the same point selection on the new image, and Measure again.

Does that help?

Good day Toni,

as far as I understand, your problem is not really related to the Fourier-spectral representation of images but to image data representations per se.

If you need to reproducibly select defined coordinates (points) and determine the according values, you are best served by transferring the point-selection from one image to another by typing “Shift-Cmd-e” on a Mac. If you have several selections per image, then you should have a look at the ROI-manager.

The values are determined by the “Measure” command.

Please consult the ImageJ manual for details.

Best

Herbie

Dear Toni,

it appears to me that everything has been explained already …

Under “Process > FFT > FFT Options” check “Compex FT” and “Do forward transform”.
2.
Performing the FFT of your image results in a stack, the first slice of which gives you the Real part and the second the Imaginary part of the Fourier-spectrum.
3.
Under “Analyze > Set Measurements…” check “Integrated density”.
4.
Double-click on the Point Selection Tool in the toolbar.
In the Dialog check “Auto-measure” and “Auto-next slice”.
Close the Dialog with OK.
5.
Display the Real-slice (scroll bar to the left).
Set the Point Selection at the desired spatial frequency and simply click.
Afterwards: Don’t move the cursor!
Click again.
6.
The Results table now shows you the x,y-coordinates of the point selection as well as the corresponding real and complex amplitude values.
7.
Take your pocket calculator and do the phase computation by use of these two values.

Finally, you may want to know how the x,y-coordinates relate to the frequency coordinates:
With the discrete Fourier-transformation (e.g. FFT), the highest displayed frequency is the Nyquist-frequency which is half the sampling frequency. The sampling frequency in turn is 1/(pixel distance) in the image.
ImageJ assumes the Fourier-spectral origin in the middle of the frequency plane, e.g. if you have a 512x512 image, the Fourier-spectral origin, i.e. spatial frequency=0, is at point x=y=256.

This is all you need.

Regards

Herbie

If I followed correctly, the way to get these pointwise measurements is:

Click on the "Multi-point or point" button on the menu bar.
Select a point on the FFT window (the Complex stack is left alone (?)).
Click on "Analyze" and select "Measure".


In the example in the image below, the phase would be \arctan(93/110) = 40.2^\circ?

Toni,

not perfectly.

Click on the "Multi-point or point" button on the menu bar.
Select a point on the FFT window (the Complex stack is left alone (?)).
Click on "Analyze" and select "Measure".


The last step is wrong and I fear previous steps as well.

Here is an example of a Results window. After the correct acquistion of the values it must contain two lines of data.

Regards

Herbie

I am having problems with this part of your instructions:

I see how one can select a “desired spatial frequency” off of the FFT window, but I don’t know if that is what you are explaining, since the line right before on point (5) you left it at setting up the Real-slice - is the point selection performed on the Complex (Real) image? If so, how?

In whichever case, I keep on double-clicking on the point, and nothing happens…

Toni,

There is little sense in stepping in later if you’ve made errors before.

Did you perform step 4?

Double-click on the Point Selection Tool in the toolbar.
In the Dialog check “Auto-measure” and “Auto-next slice”.
Close the Dialog with OK.

.

In whichever case, I keep on double-clicking on the point, and nothing happens

Where do you read double clicking?
Not funny!

Regards

Herbie

As an example, I aimed for position 512\times 512, although I ended up at 511\times511, on the FFT window (on the right of the image below) to get the frequency and amplitude. Then I tried really hard to select the same point on the (Real) part of the Complex window (on the image below it ended up capturing the Imaginary part, but it wasn’t like this when I took the measure). This was a two-step, process, more challenging in terms of manual dexterity positioning the cross bars than anything else. There ought to be a way of selecting a point on all windows. Finally I don’t know which numbers to use to calculate the \arctan(\cdot):

Toni,

you are still away from the correct procedure.

If you performed step 4 correctly (which is required only once) then you don’t need to find the same position in the imaginary part. You just don’t have to move the cursor after the first click. The slice changes automatically from Real to Imaginary after the first click.

You have three lines of data in the Results window which tells me that something went wrong.

Furthermore, you didn’t perform step 3:

Under “Analyze > Set Measurements…” check “Integrated density” only.

The whole procedure is really easy and I wonder why you don’t follow the steps in the correct order and after reading them carefully.

Regards

Herbie

I did follow step 4, and it does give me two lines, but I have to click twice on the (Real) part of the Complex plot, and then I get something like:

But in doing so, I’m ignoring completely the FFT plot, and I don’t know how to get the amplitude, frequency, and phase from these two lines of output.

Toni,

not bad so far, but what about step 3 (which is also required only once) ?

[…] but I have to click twice on the (Real) part of the Complex plot

That’s exactly what I wrote in step 5:

Display the Real-slice (scroll bar to the left).
Set the Point Selection at the desired spatial frequency and simply click.
Afterwards: Don’t move the curser!
Click again.

.

But in doing so, I’m ignoring completely the FFT plot

Which FFT plot?

Evidently you didn’t perform step 1:

Under “Process > FFT > FFT Options” check “Compex FT” and “Do forward transform”.

Don’t check any other option in this dialog.

What you need is the real part and the imaginary part of the Fourier-spectrum. You don’t need the logarithmic power spectrum.

Meanwhile I have the impression that you don’t know what you heading to.
Perhaps you need to deal with Fourier-theory first.

Regards

Herbie

[…] and I don’t know how to get the amplitude, frequency, and phase from these two lines of output.

The modulus of the amplitude is given by the length of the pointer in the complex plane.
The phase is given as suggested.
The frequency computes from the x,y-coordinates as described before.

From the Results table you get:

Re{ complex amplitude } = IntDen@slice1;
Im{ complex amplitude} = IntDen@slice2;

All this should be evident from Fourier-theory and from my above explanations.

Good luck and good bye

Herbie

I did follow step 1, but I had left FFT window unchecked. Now I can reproduce the process as you spelled it out. Thanks again. I have a lot to learn about Fourier theory. Perhaps you can remember a time when you weren’t so knowledgeable.

Perhaps you can remember a time when you weren’t so knowledgeable.

In such situations I’ve studied textbooks and by the way, not following well structured advice is a different issue.

Regards and good night

Herbie

Perhaps the communication would be easier if you checked your grammar, indentation and formatting (Markdown is ideal in this context) to avoid ambiguities on a software-centric question most suitable for a youtube video, and either decided to offer assistance or not without the additional ad hominem, gratuitous comments.

Toni,

it would have been a good idea to not delete those of your posts that I did refer to.
The initial post changed dramatically as well - why?

Have a nice weekend

Herbie

I edited my posts in chronological sequence to maximize readability, and prevent any of your intermediate posts from becoming unmoored, hopefully humoring your request. These were initially deleted to prevent clutter.

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)