Re: Reverse FFT ? [message #21082] |
Wed, 09 August 2000 00:00 |
Jonas
Messages: 23 Registered: May 1998
|
Junior Member |
|
|
Hi
Oki, if you have the real and imaginary part of the image, just put them in
a 2d complex vector and do a 2D FFT (forward or reverse?) on that vector.
The result is your 2D k-space (maybe you would like to shift the resulting
data so that the lowest "frequency", ie the k-space center, is centered in
the image instead of positioned in the corners). Note that the kspace _is_ a
complex space, so you should not do the FFT on the real and imaginary part
separately, instead you should combine them to a complex vector and then do
the FFT... something like this (assuming that your real and imaginary images
are stored in two 2d vectors called real_part and imag_part):
;combine the real and imaginary part to a complex image
complex_image = complex(real_part, imag_part)
;perform fft
k_space = FFT(complex_image, /inverse)
;shift the image data to get centre of kspace in the centre of the image
;assuming the size of the image is [xsize,ysize]
k_space = SHIFT(k_space, xsize/2, ysize/2)
So, how do you visualise the complex valued kspace in the best way? Well the
most common way to take a look at the k-space is to take a look at the
magnitude of it:
tvscl, abs(k_space)
Since the difference between the highest signal value, ie the center of
kspace, and the surrounding values are so large, maybe you instead would
like to look at the logarithm of the kspace:
tvscl, alog(abs(k_space)
hope this helps a bit....
regards
/Jonas
--
====================================
Jonas Svensson, MSc
Medical Physicist, MRI
Department of Radiation Physics
Malm� University Hospital
SE-205 02 Malm�, SWEDEN
+46 40 331021 (phone), +46 40 963185 (FAX)
Richard Tyc <richt@sbrc.umanitoba.ca> skrev i
diskussionsgruppsmeddelandet:8mrobi$ne3$1@canopus.cc.umanito ba.ca...
> Thanks Jonas,
>
> I do retain the phase and magnitude image (from which I can find the Real
> and Imaginary Data).
>
> So, from Craig's reply, I should be able to find "k" space by doing a
> reverse FFT on the Real/Imaginary image date right ?
> Would the real part of this reverse FFT solution be true k space ? ie.
> setting the second term to a negative number
> Also, would I have to do a 1D FFT Row by Row on my data or can it be done
> as a 2D FFT.
>
>
> Rich
>
> Jonas <jonas_2@hotmail.com> wrote in message
> news:8mrhpq$hkk$1@news.lth.se...
>> Hi Rich
>>
>> If the image data you have is not complex, then it is not possible to
>> retrieve the correct k-space data by doing an FFT. A reconstructed MR
> image
>> is always in complex form (to be represented by a mgnitude and a phase
>> angle, or by a real and an imaginary number), but the image shown on the
>> screen is the magnitude of each complex number. If you only have the
>> magnitude data, you have "thrown away" some important information, and
> will
>> not be able to get a correct k-space. k-space is by definition filled
with
>> complex data.
>>
>> Furthermore, if I remember my MR physics correct, you are supposed to do
a
>> forward transform when going from image space to k-space, but I am not
>> sure...
>>
>>
>> However, if you just want to have a look at a "general k-space", you
might
>> take a look at the magnitude of a FFT of a magnitude image... don't
forget
>> to shift the transformed data so that the lowest frequency is centered
in
>> the image....
>>
>> regards
>> Jonas
>>
>>
>> --
>> ====================================
>> Jonas Svensson, MSc
>> Medical Physicist, MRI
>> Department of Radiation Physics
>> Malm� University Hospital
>> SE-205 02 Malm�, SWEDEN
>> +46 40 331021 (phone), +46 40 963185 (FAX)
>>
>>
>
>
>
|
|
|
Re: Reverse FFT ? [message #21087 is a reply to message #21082] |
Wed, 09 August 2000 00:00  |
Richard Tyc
Messages: 69 Registered: June 1999
|
Member |
|
|
Thanks Jonas,
I do retain the phase and magnitude image (from which I can find the Real
and Imaginary Data).
So, from Craig's reply, I should be able to find "k" space by doing a
reverse FFT on the Real/Imaginary image date right ?
Would the real part of this reverse FFT solution be true k space ? ie.
setting the second term to a negative number
Also, would I have to do a 1D FFT Row by Row on my data or can it be done
as a 2D FFT.
Rich
Jonas <jonas_2@hotmail.com> wrote in message
news:8mrhpq$hkk$1@news.lth.se...
> Hi Rich
>
> If the image data you have is not complex, then it is not possible to
> retrieve the correct k-space data by doing an FFT. A reconstructed MR
image
> is always in complex form (to be represented by a mgnitude and a phase
> angle, or by a real and an imaginary number), but the image shown on the
> screen is the magnitude of each complex number. If you only have the
> magnitude data, you have "thrown away" some important information, and
will
> not be able to get a correct k-space. k-space is by definition filled with
> complex data.
>
> Furthermore, if I remember my MR physics correct, you are supposed to do a
> forward transform when going from image space to k-space, but I am not
> sure...
>
>
> However, if you just want to have a look at a "general k-space", you might
> take a look at the magnitude of a FFT of a magnitude image... don't forget
> to shift the transformed data so that the lowest frequency is centered in
> the image....
>
> regards
> Jonas
>
>
> --
> ====================================
> Jonas Svensson, MSc
> Medical Physicist, MRI
> Department of Radiation Physics
> Malm� University Hospital
> SE-205 02 Malm�, SWEDEN
> +46 40 331021 (phone), +46 40 963185 (FAX)
>
>
|
|
|
Re: Reverse FFT ? [message #21088 is a reply to message #21082] |
Wed, 09 August 2000 00:00  |
Jonas
Messages: 23 Registered: May 1998
|
Junior Member |
|
|
Hi Rich
If the image data you have is not complex, then it is not possible to
retrieve the correct k-space data by doing an FFT. A reconstructed MR image
is always in complex form (to be represented by a mgnitude and a phase
angle, or by a real and an imaginary number), but the image shown on the
screen is the magnitude of each complex number. If you only have the
magnitude data, you have "thrown away" some important information, and will
not be able to get a correct k-space. k-space is by definition filled with
complex data.
Furthermore, if I remember my MR physics correct, you are supposed to do a
forward transform when going from image space to k-space, but I am not
sure...
However, if you just want to have a look at a "general k-space", you might
take a look at the magnitude of a FFT of a magnitude image... don't forget
to shift the transformed data so that the lowest frequency is centered in
the image....
regards
Jonas
--
====================================
Jonas Svensson, MSc
Medical Physicist, MRI
Department of Radiation Physics
Malm� University Hospital
SE-205 02 Malm�, SWEDEN
+46 40 331021 (phone), +46 40 963185 (FAX)
Richard Tyc <richt@sbrc.umanitoba.ca> skrev i
diskussionsgruppsmeddelandet:8mpv4l$rtl$1@canopus.cc.umanito ba.ca...
> Can you do a reverse FFT in IDL and how is it implemented ?
> ie. FFT provides a complex array - How do you get the original Time domain
> back from the complex series.
>
> I am trying to retrieve "k" space data back from real/imaginary MRI data.
I
> would like to see how time consuming this really is.
>
> Thanks
> Rich
>
>
|
|
|
Re: Reverse FFT ? [message #21097 is a reply to message #21082] |
Tue, 08 August 2000 00:00  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
"Richard Tyc" <richt@sbrc.umanitoba.ca> writes:
> Can you do a reverse FFT in IDL and how is it implemented ?
> ie. FFT provides a complex array - How do you get the original Time domain
> back from the complex series.
>
> I am trying to retrieve "k" space data back from real/imaginary MRI data. I
> would like to see how time consuming this really is.
The direction of the FFT is controlled by the sign of the second
argument to the FFT() function call.
You can verify that you have recovered the original signal by the
following example:
yt1 = randomn(seed,256) ;; Original signal
yf = fft(yt1, +1) ;; Transformed signal
yt2 = fft(yf, -1) ;; Transformed-transformed signal
Formally, the values of YT1 (the original signal) and YT2 (the
transformed-untransformed signal) should be identical. Let's check
that:
plot, abs(yt1-yt2)
The residuals are very close to zero. Two things are noteworthy.
First, YT2 is always going to be COMPLEX rather than float. This is
because the FFT is by definition a complex algorithm. Still, the
recovered signal should be *primarily* real.
Which gets to the second point. You won't ever fully recover the
original signal since there is some round-off error. That's why the
residuals are non-zero (and even complex). I believe that Liam Gumley
has a web page on the numerical accuracy of FFT's.
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|