How to obtain the FFT of a 4D image

16 visualizaciones (últimos 30 días)
DM
DM el 1 de Mzo. de 2022
Comentada: Walter Roberson el 1 de Mzo. de 2022
Hi,
I have a 4D image [x,y,z,t] and I would like to plot the FFT of the signal of a region of interest.
I load my image and I store the signal of the region of interest in a vector y. I used the fft function
X=fft(y(:))
I wanted to see the spectrum plot of the signal and I tried the following but I am getting an error "Error using plot
Not enough input arguments."
plot, X
From what I've read I need to define the frequency domain but I don't know how. From the example I've seen online (https://uk.mathworks.com/help/matlab/ref/fft.html) the frequency domain has been cacluated using the sampling frequncy and length of the signal. But these two have been defined manually. In my case where my input signal comes from an image how can I define the frequency domain?

Respuestas (1)

Matt J
Matt J el 1 de Mzo. de 2022
plot(X)
  6 comentarios
Matt J
Matt J el 1 de Mzo. de 2022
Again, I don't think the creation of f has anything to do with it. Try this, and see if there's a substantial difference.
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
plot(P1)
Walter Roberson
Walter Roberson el 1 de Mzo. de 2022
You have a 2D ROI. Which of the 4 planes is the ROI against? Or to phrase it another way, which dimensions are having their values constrained, and which dimensions are "all entries"?
Then, which dimension do you want the fft to be taken over?
Imagine that you had a 48 x 64 x 32 x 100 image, then if your ROI was against the first two dimensions, then each element of the ROI filters to a 1 x 1 x 32 x 100 image. If your time were the last dimension, then you would want to be doing 32 different fft's for each entry selected by the ROI. How would you then want the 32 different plots to be presented? https://www.mathworks.com/help/matlab/ref/stackedplot.html perhaps? But that would be (in this example) one group of plots for each element of your ROI, and your ROI probably has multiple entries.
X=fft(y(:))
Don't do that. You have extracted 2 dimensions for each ROI member, and your ROI adds at least one more dimension, so you are grouping 3 dimensions of data into a single vector and expecting the FFT to be meaningful.

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by