Unfortunately, the MRIQuestions.com forum became unmanageable due to spam attacks. I recommend an alternative resource: www.imagingQA.com
Phase image - Printable Version

+- Unfortunately, the MRIQuestions.com forum became unmanageable due to spam attacks. I recommend an alternative resource: www.imagingQA.com (http://mriquestions.com/forum)
+-- Forum: Making an Image (/forumdisplay.php?fid=6)
+--- Forum: Frequency and Phase Encoding (/forumdisplay.php?fid=24)
+--- Thread: Phase image (/showthread.php?tid=3452)



Phase image - Micz - 06-17-2015 11:37 PM

Hi
Please explain me how the phase image is created. I know that brightness is a code of change in phase calculated from Real and Imaginary part. But if phase and frequency is changed due to motion how the value of prase shift can be displayed in the right position of 2d plane.
Best regards.


RE: Phase image - AndrewBworth - 08-09-2015 01:11 AM

OK - you are a little mixed up I think. Studying just MRI - I think it's not very easy to see what the phase image is and is good for. And to add to that - the word phase gets thrown around a bit - and it isn't always referring to the same thing. NMR guys usually have less trouble with this. I hope I don't butcher this too badly:

What is the frequency in the center of k-space? it's 0. To one side of this, we have a growing negative frequency, and the other side a growing positive frequency. Now imagine a detector, detecting our signal... and let's say we are sampling a signal below the nyquist frequency (I originally tried this AT the nyquist frequency -what a headache), and our detector is oriented along the x-axis. So our signal, normalized, would be alternating between 1, -1, 1, -1, 1, -1. Is this signal clockwise or counterclockwise? On which side of the center frequency does it belong? We can't tell, and neither can the fourier transform. If we Fourier transform this signal, we'll get peaks or images on both sides of the center frequency, each identical. If we did our whole image this way, our image would be ruined, with a mirror image of the left side on the right, and a mirror image of right side on the left (or superior on inferior, etc. -however you are visualizing).
So how do we fix this? One option would be to put our zero frequency far to one side, so that we can be assured all our frequencies are of the same sign. This works, but we have to at least DOUBLE our bandwidth - we may only want the data from zero to a max positive frequency, but we are still sampling out to a max negative frequency, whether we like it or not. Another, better more practical option is to detect in the x-direction, and the y-direction (this is known as quadrature detection. Do not confuse with quadrature coils, this is not what they are for). Now, if we look at our signal again, our x detection is going from 1 to 0 to -1 to 0 to 1, and our y detection is going from 0 to 1 to 0 to -1 to 0... We can see, our signal is going counterclockwise - a positive frequency. We now know how our fourier transform should look - a peak/image on the positive side of 0, with nothing on the negative side. Our intuition knows how it should look, and imaging it is easy - but computers are dumb - how does the computer do it?
The "official" kernel for the fourier transform is complex, exp(-i*omega*t) (OK, in MRI instead of time, t, it's k positition - I switch between the two without really thinking.) . This can be represented a few different ways - the one we want right now is exp(-i*omega*t) = cos(omega*t) - i*sin(omega*t). I've omitted some constants - you'll have to compare this explanation to others to get it precise. Now, let's make our x detected signal our real number components, and y detected our imaginary components. We'll set up the Fourier transform as an integral evaluated over k-space (just worry about one dimension, or just imagine that we repeat the process down the phase direction) as (x + iy)(cos(omega*k) - i*sin(omega*(k)), split into a real and an imaginary integral of (x*cos(omega*k) + y*sin(omega*k)) and i(x*sin(omega*k) - y*cos(omega*k)). Now - in this perfectly phased example, our real numbers x refer to a cos function and the y a sin function, with a positive frequency. Our real image will consist of a positive peak on both positive and negative sides thanks to the cos part of the transform, and a negative peak on the negative side and a positive peak on the positive side thanks to the sin part. These should add together, to yield a single peak on the positive side - this is the real spectrum. The imaginary spectrum, in this case is perfectly blank. The real spectrum, in most cases - would be the image, but sometimes the magnitude image is viewed as the image. If properly phased - they ought to be the about the same, unless there are portions of the image which have phase errors due to flow along a gradient.
How do you "phase" an image? Most (all?) MRI's phase the image automatically - so I don't know exactly how they do it. However, NMR scientists phase spectra in their sleep. We previously represented our data as complex values in the form x + iy. However, complex numbers are also vectors, and they can be represented as such. With r = (x^2 + y^2)^(1/2), our numbers are then r(cos(theta) + i*sin(theta)) = x + i*y. We phase our data by adding in phase terms to make the data line up nicely into an image. For a 2D fourier transform, we would add a constant phase term to all values, and first order phase terms for the kx and ky position, so our data is now
r(cos(theta + omega1 + omega2*kx + omega3*ky) + i*sin(theta + omega1 + omega2*kx + omega3*ky). The phase is now corrected for a general timing offset as well as position. If a vendor has different phase terms or higher order terms etc. I cannot be sure.
If some fluid flows through a gradient, it will acquire some phase different from the rest of the protons scanned. If the phase is acquired during a slice select or readout gradient, assuming laminar flow, these protons will pick up an additional phase constant. Because of this phase constant, these protons will not be able to be perfectly phased on the real image, and will appear less intense than the magnitude image. However, it will be in the right place. If the flow is pulsatile or is acquired during a phase gradient, it will aquire a phase constant that varies, meaning that the protons will appear to have an incorrect frequency or multiple frequencies - they will appear in the wrong place as an artifact and I believe will have varying intensities. How big a deal this is depends on which gradient it is, how pulsatile the motion....
Lastly, the magnitude image is just that - using the pythagorean theorum the magnitude at each pixel is calculated: (R^2 + I^2)^(1/2). The phase image is the phase of the vector before transform - given as arctan(I/R). Yes, you should be able to spot significant flow this way. One could also probably try a Magnitude - Real image to look for flow. What you are essentially seeing is extra dephasing caused by the flow. The reason the flow shows up in the right place - is because the amount of phase gained is nearly constant - it's the frequency that determines position and that hasn't changed (assuming laminar flow).


RE: Phase image - ksawery - 09-14-2016 04:46 PM

[Image: disgusted-mother-of-god.png]


(08-09-2015 01:11 AM)AndrewBworth Wrote:  OK - you are a little mixed up I think. Studying just MRI - I think it's not very easy to see what the phase image is and is good for. And to add to that - the word phase gets thrown around a bit - and it isn't always referring to the same thing. NMR guys usually have less trouble with this. I hope I don't butcher this too badly:

What is the frequency in the center of k-space? it's 0. To one side of this, we have a growing negative frequency, and the other side a growing positive frequency. Now imagine a detector, detecting our signal... and let's say we are sampling a signal below the nyquist frequency (I originally tried this AT the nyquist frequency -what a headache), and our detector is oriented along the x-axis. So our signal, normalized, would be alternating between 1, -1, 1, -1, 1, -1. Is this signal clockwise or counterclockwise? On which side of the center frequency does it belong? We can't tell, and neither can the fourier transform. If we Fourier transform this signal, we'll get peaks or images on both sides of the center frequency, each identical. If we did our whole image this way, our image would be ruined, with a mirror image of the left side on the right, and a mirror image of right side on the left (or superior on inferior, etc. -however you are visualizing).
So how do we fix this? One option would be to put our zero frequency far to one side, so that we can be assured all our frequencies are of the same sign. This works, but we have to at least DOUBLE our bandwidth - we may only want the data from zero to a max positive frequency, but we are still sampling out to a max negative frequency, whether we like it or not. Another, better more practical option is to detect in the x-direction, and the y-direction (this is known as quadrature detection. Do not confuse with quadrature coils, this is not what they are for). Now, if we look at our signal again, our x detection is going from 1 to 0 to -1 to 0 to 1, and our y detection is going from 0 to 1 to 0 to -1 to 0... We can see, our signal is going counterclockwise - a positive frequency. We now know how our fourier transform should look - a peak/image on the positive side of 0, with nothing on the negative side. Our intuition knows how it should look, and imaging it is easy - but computers are dumb - how does the computer do it?
The "official" kernel for the fourier transform is complex, exp(-i*omega*t) (OK, in MRI instead of time, t, it's k positition - I switch between the two without really thinking.) . This can be represented a few different ways - the one we want right now is exp(-i*omega*t) = cos(omega*t) - i*sin(omega*t). I've omitted some constants - you'll have to compare this explanation to others to get it precise. Now, let's make our x detected signal our real number components, and y detected our imaginary components. We'll set up the Fourier transform as an integral evaluated over k-space (just worry about one dimension, or just imagine that we repeat the process down the phase direction) as (x + iy)(cos(omega*k) - i*sin(omega*(k)), split into a real and an imaginary integral of (x*cos(omega*k) + y*sin(omega*k)) and i(x*sin(omega*k) - y*cos(omega*k)). Now - in this perfectly phased example, our real numbers x refer to a cos function and the y a sin function, with a positive frequency. Our real image will consist of a positive peak on both positive and negative sides thanks to the cos part of the transform, and a negative peak on the negative side and a positive peak on the positive side thanks to the sin part. These should add together, to yield a single peak on the positive side - this is the real spectrum. The imaginary spectrum, in this case is perfectly blank. The real spectrum, in most cases - would be the image, but sometimes the magnitude image is viewed as the image. If properly phased - they ought to be the about the same, unless there are portions of the image which have phase errors due to flow along a gradient.
How do you "phase" an image? Most (all?) MRI's phase the image automatically - so I don't know exactly how they do it. However, NMR scientists phase spectra in their sleep. We previously represented our data as complex values in the form x + iy. However, complex numbers are also vectors, and they can be represented as such. With r = (x^2 + y^2)^(1/2), our numbers are then r(cos(theta) + i*sin(theta)) = x + i*y. We phase our data by adding in phase terms to make the data line up nicely into an image. For a 2D fourier transform, we would add a constant phase term to all values, and first order phase terms for the kx and ky position, so our data is now
r(cos(theta + omega1 + omega2*kx + omega3*ky) + i*sin(theta + omega1 + omega2*kx + omega3*ky). The phase is now corrected for a general timing offset as well as position. If a vendor has different phase terms or higher order terms etc. I cannot be sure.
If some fluid flows through a gradient, it will acquire some phase different from the rest of the protons scanned. If the phase is acquired during a slice select or readout gradient, assuming laminar flow, these protons will pick up an additional phase constant. Because of this phase constant, these protons will not be able to be perfectly phased on the real image, and will appear less intense than the magnitude image. However, it will be in the right place. If the flow is pulsatile or is acquired during a phase gradient, it will aquire a phase constant that varies, meaning that the protons will appear to have an incorrect frequency or multiple frequencies - they will appear in the wrong place as an artifact and I believe will have varying intensities. How big a deal this is depends on which gradient it is, how pulsatile the motion....
Lastly, the magnitude image is just that - using the pythagorean theorum the magnitude at each pixel is calculated: (R^2 + I^2)^(1/2). The phase image is the phase of the vector before transform - given as arctan(I/R). Yes, you should be able to spot significant flow this way. One could also probably try a Magnitude - Real image to look for flow. What you are essentially seeing is extra dephasing caused by the flow. The reason the flow shows up in the right place - is because the amount of phase gained is nearly constant - it's the frequency that determines position and that hasn't changed (assuming laminar flow).