x, [cm] - inst.eecs.berkeley.edu

EE225E/BIOE265 Spring 2013
Principles of MRI
Miki Lustig
Assignment 2 Solutions
1. Read Nishimura Ch. 3
2. Interpolation in k-space: In this problem we will see the effect of linear interpolation in k-space.
This is a more involved version of the question that was given in the midterm in 2010. The following
image was resampled in the vertical direction in k-space by linear interpolation at 34 the original rate.
Interpolation in k-space corresponds to finer k-space sampling and therefor a larger FOV. So, the
FOV of the interpolated image (right) is larger in the vertical dimension.
There are two distinct artifacts that appear in the interpolated image and not in the original. The
interpolated image is apodized (no longer has flat magnitude). In addition, there are some aliasing
artifacts that appear as replication of the image in the interpolated dimension. These artifacts are
the result of using a linear interpolation as opposed to a better interpolation scheme. In the following
questions we will learn the source of these artifacts through a simple 1D example.
You are given the following 1D signal that you want to sample in k-space. In this question, f (x) is
the space signal and F (k) is its k-space.
f(x)
25.6
x, [cm]
-48
-32
-16
0
1
16
32
48
8
cycles/cm. Express fˆ(x), the
a) You decide to collect 256 k-space samples of F (k) with ∆k = 256
result of sampling F (k) in k-space, as a function of f (x). Draw the signal fˆ(x). Emphasize any
artifacts in the drawing and point out the differences with the original f (x).
Solution:
There are going to be two effects. Blurr due to the finite extent in k-space and replication
8
due to the discrete sampling. Since ∆k = 256
and the number of samples is 256 the total
8
extent in k-space is Wkz = 256 256 = 8 cycles/cm. The finite extent can therefore be written
as a multiplication with the rect function u(k/8). The discrete sampling at rate of ∆k =
8
256
256
256 cycles/cm can be written as a multiplication with the Shah function 8 X( 8 k). So, we
can write F̂ (k) as,
256
k
256
X(
k) · u( ).
F̂ (k) = F (k) ·
8
8
8
Taking the inverse Fourier transform yields,
8
x)
fˆ(x) = f (x) ∗ 8sinc(8x) ∗X(
|
{z
}
256
blurr
|
=
blurr
{z
}
replication
∞
8 X
(f (x) ∗ 8sinc(8x)δ(x − 32n)
256 n=−∞
ringing
^
f(x)
1/32
-48
-32
-16
0
16
32
48
x, [cm]
b) You prepare to show the results from part (a) to your adviser, however, you suddenly remember
6
cycles/cm. Not wanting
that he asked you to sample k-space at a finer interval of ∆k = 256
to repeat the experiment, you decide to interpolate F̂ (k) and resample it accordingly. Write
an expression for F̃ (k), the resampled signal, assuming linear interpolation. Express F̃ (k) as a
function of F̂ (k),
HINT:
linear interpolation is a convolution with an appropriately scaled triangle function Λ(ak) =
(
1 − |ak| |ak| < 1
0
otherwise
Solution:
8
Linear interpolation is a convolution with a triangle function. Our samples are spaced at 256
256
cycles/cm interval, so the convolution is with Λ( 256
8 k). The result Λ( 8 k) ∗ F̂ (k) is a continuous
function. In order to resample, we need to multiply the continuous function with an impulse
6
train at 256
cycles/cm interval. Therefore we get that,
256
256
256
k) ∗ F̂ (k)
X(
k)
F̃ (k) = Λ(
8
6
6
c) Write an expression for f˜(x), the image domain representation of F̃ (k) from part (b). First
express f˜(x) as a function of fˆ(x) and then as a function of f (x). Draw f˜(x), pointing out
2
any artifacts due to the interpolation and resampling.
(HINT: First try to draw the effect of the interpolation, then draw the effect of the resampling.)
Solution:
For this question we need to know that the Fourier transform of a triangle function is, F −1 {Λ(k)} =
1
sinc2 (x). So, F −1 {Λ(ak)} = |a|
sinc2 (x/a). This can also be derived from the relation Λ(k) =
u(k) ∗ u(k).
So, the convolution and resampling yields,
8
6
8
sinc2 (
x) ∗ X(
x).
f˜(x) = fˆ(x) ·
256
256
256
and,
f˜(x) =
Drawinf fˆ(x) ·
~
f(x)
-48
8
8
6
8
x) ·
sinc2 (
x) ∗ X(
x).
f (x) ∗ 8sinc(8x) ∗ X(
256
256
256
256
8
2 8
256 sinc ( 256 x)
-32
we get,
-16
0
16
32
48
x, [cm]
in which the replicas have not been fully suppressed and the signal heavily apodized.
6
Convolving the result with X( 256
x) we get,
-48
-32
-16
0
16
32
48
x, [cm]
0
16
32
48
x, [cm]
aliasing
~
f(x)
-48
-32
-16
3
d) Linear interpolation can be considered as interpolating with a poor low-pass filter. How would
the result change if we use a filter with 0.1% ripple in the pass-band and stop band for the
interpolation? Draw the result pointing out the differences.
Solutions:
A TBW=8 windowed sinc is a better filter and suppresses the replicas much better as illustrated
below:
slight apodization
~
f(x)
-48
-32
-16
0
16
32
48
x, [cm]
The replication of the signal will have negligible aliasing within the field of view!
~
f(x)
almost no aliasing
-48
-32
-16
0
16
32
48
x, [cm]
3. RF Field
(a) Find the amplitude of an RF pulse that performs a 90 degree excitation in exactly 1 ms at 1.5T.
Solution:
A 90 degree excitation is π/2 flip angle. At the same time, τ = 1ms and γ/2π = 42.57MHz/T.
In the rotating frame the magnetization will precess around the applied field at a rate ω = γB1 .
We get that,
π/2 = γB1 τ
and therefore B1 = 5.8719E − 6 ≈ 6µT.
(b) Find the amplitude of an RF pulse that performs a 90 degree excitation in exactly 1 ms at 3T.
Solution:
In the rotating frame the magnetization precesses around the applied field. Therefore the result
at 3T is the same as in 1.5T and is independent of the main magnetic field.
4. Non-Linear gradients. One of the key elements in MRI is the use of a gradient field G which
establishes a linear relationship between resonance frequency and position. While the linear model is
convenient for analysis, real gradients are seldom exactly linear. In this problem we will look at some
of the consequences of gradient non-linearity. This is a REAL situation in every scanner!
(a) Consider a gradient system with the response shown by the solid line. A linear model is shown
as the dashed line.
4
20
10
0
-10
Linear Model
-20
Frequency, kHz
Actual Gradient
-20
-10
0
Position, z, cm
10
20
Assume the object is a sequences of rectangles of uniform intensity.
M0
4cm
4cm
-20
-10
0
10
20
Position, z, cm
Sketch the one dimensional image we would get if we encode using the real gradient (solid
line) but use the linear approximation (dashed line) when we resconstruct the data (i.e. assign
spatial positions to different frequencies.) Things to look for are spatial distortion, and intensity
variations.
(b) The non-linearity in the gradient can be measured, and then used to more accurately reconstruct
the data. Assume that the gradient field produces a frequency
ω(z) = γ(Gideal z + Hz 3 )
(1)
10
0
-10
-20
Frequency, kHz
20
where Gideal = 0.235 G/cm, and H = −1.9 × 10−4 G/(cm3 ), and z ranges from ±20 cm. If we
have a data acquisition window of 10 ms, we can resolve frequencies of 100 Hz. What spatial
resolution does this provide at z = 0, 10, and 20 cm?
(c) Would this gradient profile work for spatial encoding for MRI? Why or why not? Assume that
the object extends from -20 cm to 20 cm.
-20
-10
0
Position, z, cm
5
10
20
5. Matlab assignment: 2D Fourier transforms:
Use the function publish to make your report.
In this assignment we will play with 2D Fourier transforms. As mentioned in class, in MRI the (0,0)
coordinates both in k-space and of the image are located in the center. The functions fft2 and ifft2
in Matlab place the origin of the axis at the corner of the image. We will therefore need to write new
functions that compute the centered DFT.
(a) Program the functions F=fft2c(f) and f=ifft2c(F). Recall that
>> F = ifftshift(fft2(fftshift(f)));
>> f = fftshift(ifft2(ifftshift(F)));
(b) Rectangles in k-space. Download the functions mysinc.m and myjinc.m. The functions implement the sinc and jinc function as described in class. They accepts a vector (or matrix) of
inputs and return the results in the same format as the input.
The Fourier transform of a rectangle with length 18[cm] and amplitude 1 is
F (k) = 182 sinc(18kx )sinc(18ky )
We would like to sample the rectangle in k-space while achieving a resolution of 1mm and a
25.6cm Field of view. Recall from class that the resolution ∆x = W1kx where Wkx is the extent
1
in k-space. Also recall that FOVx = ∆k
where ∆kx is the spacing between samples in k-space.
x
For 1mm, we get that Wkx = 10 and ∆kx = 10/256.
To sample the function we will create a grid using the function meshgrid. First, let’s create the
intervals:
>>
>>
>>
>>
>>
>>
Wkx = 10;
Wky = 10;
Nx = 256;
Ny = 256;
kx_itvl = [ -Nx/2:Nx/2-1]/Nx * Wkx;
ky_itvl = [ -Ny/2:Ny/2-1]/Ny * Wky;
Now, we will create the grid and evaluate the function
>> [kx, ky] = meshgrid(kx_itvl, ky_itvl);
>> F = 18*18*mysinc(18*kx).*mysinc(18*ky);
Since the sample lie on a grid, we can reconstruct the data using the inverse fft. In the inverse fft,
the data is scaled by 1/(N xN y) = 1/(2562 ). On the other hand, each point in k-space represents
an area of ∆kx ∆ky = 102 /2562 . So, for the ifft to approximate the inverse Fourier transform we
need to multiply the result by a 100. This is however not very important in MRI. The actual
scaling of an image in MRI depends on many things and can vary significantly between scans.
The contrast in the image is the important information. We will do it here just so the rectangle
will have an amplitude of 1. But again, this is not so important.
6
>> f = 100*ifft2c(F);
>> figure(1), imshow(abs(f),[]), title(’|f|’)
>> figure(2), imshow(angle(f),[]), title(’The phase of f’);
Validate that the size of the rectangle is 180 pixels.
In a similar way we can sample a circle in k-space. Here’s an example of a circle with a diameter
of 20cm:
>>
>>
>>
>>
>>
r = sqrt(kx.^2+ky.^2);
F_circ = 20^2*myjinc(20*r);
f_circ = 100*ifft2c(F_circ);
figure(1), imshow(abs(f_circ),[]), title(’|f|’)
figure(2), imshow(angle(f_circ),[]), title(’The phase of f’);
To demonstrate the modulation property of the Fourier transform we will shift the k-space of
the rectangle by 2∆kx . We should expect 2 cycles of phase across the FOV in the x-axis.
>>
>>
>>
>>
F_srect = 22*22*mysinc(22*(kx-10/256*2)).*mysinc(22*ky);
f_srect = 100*ifft2c(F_srect);
figure(1), imshow(abs(f_srect),[]), title(’|f|’)
figure(2), imshow(angle(f_srect),[]), title(’The phase of f’);
To shift a rectangle in the image domain, we need to modulate k-space accordingly. Here’s an
example of shifting a rectangle of length 5cm by 5cm in both axis.
>>
>>
>>
>>
F_shift = 10*10*mysinc(10*kx).*mysinc(10*ky).*exp(-i*2*pi*(5*kx+5*ky));
f_shift = 100*ifft2c(F_shift);
figure(1), imshow(abs(f_shift),[]), title(’|f|’)
figure(2), imshow(angle(f_shift),[]), title(’The phase of f’);
(c) Write the function F = rectf(kx,ky,Lx,Ly,x0,y0).
The function evaluates the Fourier transform of a rectangle.
kx and ky are k-space coordinates matrices (can be generated by meshgrid for example).
Lx and Ly are scalars corresponding to the length of the rectangle in the x and y axis.
x0 and y0 are scalars corresponding to the coordinates of the center of the rectangle.
Write the function F = circf(kx,ky,diam,x0,y0).
The function evaluates the Fourier transform of a circle.
kx and ky are k-space coordinates matrices (can be generated by meshgrid for example).
diam is a scaler representing the diameter of the circle.
x0 and y0 are scalars corresponding to the coordinates of the center of the circle.
Using these functions create the function F = face(kx,ky).
The function evaluates the Fourier transform of the following image:
7
3.5cm
1cm
1cm
Intensity=0
20cm
Intensity=0.4
4cm
1.5cm
10cm
2.5cm
Intensity=0.8
1.5cm
3.5cm
(d) Sample and display the resulting image for the following parameters:
i.
ii.
iii.
iv.
FOV
FOV
FOV
FOV
=
=
=
=
102.4 cm, resolution = 4mm
24 cm, resolution = 5mm
25.6 cm, resolution = 1mm
19.2 cm, resolution = 1mm
What happens when the imaging FOV is smaller than the object?
Solutions: The solutions are based on Frank Ong’s hw solutions. Thanks Frank!
8
Solutions:
Contents
•
•
•
•
•
•
•
•
•
•
•
•
EE225e hw2-Q5
1b
Rectangle
Circle
Shifted k-space
Modulated k-space
1d Sample and Display face
1d i) FOV = 102.4cm, res = 4mm
1d ii) FOV = 24cm, res = 5mm
1d iii) FOV = 25.6cm, res = 1mm
1d iv) FOV = 19.2cm, res = 1mm
Aliasing happens when FOV is smaller than object.
EE225e hw2-Q5
close all
clc
clear
1b
Wkx = 10;
Wky = 10;
Nx = 256;
Ny = 256;
kx_itvl = [ -Nx/2:Nx/2-1]/Nx * Wkx;
ky_itvl = [ -Ny/2:Ny/2-1]/Ny * Wky;
[kx, ky] = meshgrid(kx_itvl, ky_itvl);
F = 18*18*mysinc(18*kx).*mysinc(18*ky);
Rectangle
f = 100*ifft2c(F);
figure(1), imshow(abs(f),[]), title(’|f|’)
figure(2), imshow(angle(f),[]), title(’The phase of f’);
9
|f|
50
100
150
200
250
50
100
150
200
250
200
250
The phase of f
50
100
150
200
250
50
100
150
10
Circle
r = sqrt(kx.^2+ky.^2);
F_circ = 20^2*myjinc(20*r);
f_circ = 100*ifft2c(F_circ);
figure(1), imshow(abs(f_circ),[]), title(’|f|’)
figure(2), imshow(angle(f_circ),[]), title(’The phase of f’);
|f|
50
100
150
200
250
50
100
150
200
11
250
The phase of f
50
100
150
200
250
50
100
150
200
250
Shifted k-space
F_srect = 22*22*mysinc(22*(kx-10/256*2)).*mysinc(22*ky);
f_srect = 100*ifft2c(F_srect);
figure(1), imshow(abs(f_srect),[]), title(’|f|’)
figure(2), imshow(angle(f_srect),[]), title(’The phase of f’);
12
|f|
50
100
150
200
250
50
100
150
200
250
200
250
The phase of f
50
100
150
200
250
50
100
150
13
Modulated k-space
F_shift = 10*10*mysinc(10*kx).*mysinc(10*ky).*exp(-i*2*pi*(5*kx+5*ky));
f_shift = 100*ifft2c(F_shift);
figure(1), imshow(abs(f_shift),[]), title(’|f|’)
figure(2), imshow(angle(f_shift),[]), title(’The phase of f’);
|f|
50
100
150
200
250
50
100
150
200
14
250
The phase of f
50
100
150
200
250
50
100
150
200
250
1d Sample and Display face
1d i) FOV = 102.4cm, res = 4mm
Wkx = 10/4;
Wky = 10/4;
Nx = 1024/4;
Ny = 1024/4;
kx_itvl = [ -Nx/2:Nx/2-1]/Nx * Wkx;
ky_itvl = [ -Ny/2:Ny/2-1]/Ny * Wky;
[kx, ky] = meshgrid(kx_itvl, ky_itvl);
F = face(kx, ky);
f = Wkx*Wky*ifft2c(F);
figure(1), imshow(abs(f),[0 1]), title(’Face 1’)
15
Face 1
50
100
150
200
250
50
100
150
200
250
1d ii) FOV = 24cm, res = 5mm
Wkx = 10/5;
Wky = 10/5;
Nx = 240/5;
Ny = 240/5;
kx_itvl = [ -Nx/2:Nx/2-1]/Nx * Wkx;
ky_itvl = [ -Ny/2:Ny/2-1]/Ny * Wky;
[kx, ky] = meshgrid(kx_itvl, ky_itvl);
F = face(kx, ky);
f = Wkx*Wky*ifft2c(F);
figure(2), imshow(abs(f),[0 1]), title(’Face 2’)
16
Face 2
20
40
20 40
1d iii) FOV = 25.6cm, res = 1mm
Wkx = 10;
Wky = 10;
Nx = 256;
Ny = 256;
kx_itvl = [ -Nx/2:Nx/2-1]/Nx * Wkx;
ky_itvl = [ -Ny/2:Ny/2-1]/Ny * Wky;
[kx, ky] = meshgrid(kx_itvl, ky_itvl);
F = face(kx, ky);
f = Wkx*Wky*ifft2c(F);
figure(3), imshow(abs(f),[0 1]), title(’Face 3’)
17
Face 3
50
100
150
200
250
50
100
150
200
250
1d iv) FOV = 19.2cm, res = 1mm
Wkx = 10;
Wky = 10;
Nx = 192;
Ny = 192;
kx_itvl = [ -Nx/2:Nx/2-1]/Nx * Wkx;
ky_itvl = [ -Ny/2:Ny/2-1]/Ny * Wky;
[kx, ky] = meshgrid(kx_itvl, ky_itvl);
F = face(kx, ky);
f = Wkx*Wky*ifft2c(F);
figure(4), imshow(abs(f),[0 1]), title(’Face 4’)
18
Face 4
20
40
60
80
100
120
140
160
180
50
100
150
Aliasing happens when FOV is smaller than object.
19