david atkinson philip batchelor david larkmancomputational aspects of mri is mri data band-limited?...
TRANSCRIPT
Computational Aspects of MRI
Computational Aspects of MRI
David AtkinsonPhilip BatchelorDavid Larkman
Computational Aspects of MRI
Programme
09:30 – 11:00 Fourier, sampling, gridding, interpolation. Matrices and Linear Algebra
11:30 – 13:00 MRI
Lunch (not provided)
14:00 – 15:30SVD, eigenvalues. Regularisation, Norms, Conjugate Gradient,
Compressed Sensing.
16:00 – 17:30Coordinate systems and geometrical transforms, DICOM, Jacobians
Computational Aspects of MRI
Fourier, Sampling and Gridding
David Atkinson
Computational Aspects of MRI
Resources
• References in lecture notes http://cmic.cs.ucl.ac.uk/david_atkinson/training
• Maths for Medical Imaging summer school http://www.maths4medicalimaging.co.uk/
• MathWorld: http://mathworld.wolfram.com/• MATLAB manual.• IEEE Trans Med Imag (1999) 18 1049-1075 Survey:
Interpolation Methods in Medical Image Processing. Lehman et al.
• IEEE Trans Med Imag (1991) 30 473-478. Selection of a Convolution Function for Fourier Inversion Using Gridding. Jackson et al.
Computational Aspects of MRI
The Fourier Transform & Its Applications.Ronald Bracewell
Numerical Recipes 3rd Edition: The Art of Scientific Computing
William H. Press, Saul A. Teukolsky, William T. Vetterling, and Brian P. Flannery
Scientific Computing: An Introductory SurveyMichael T. Heath
http://www.cse.uiuc.edu/heath/scicomp/notes/
Computational Aspects of MRI
Outline
• Fourier and MRI.• Continuous and Discrete FT• Pixels and FOV.• FT pairs and relations.• Convolution.• Filtering.• Aliasing.• Sampling Theory.• The FFT.• Interpolation• Gridding
Computational Aspects of MRI
Fourier and MRIAnalogue to Digital Converter (ADC)
Samples k-space
Host reconstruction computer
Discrete Fourier Transform
dxexhkH ikx∫∞
∞−= )()(
Computational Aspects of MRI
Fourier Relations in MRI
Time domain signal from ADC[s]
Temporal Frequency
[Hz or s-1]K-spaceSpatial frequency[m-1]
Image space
[m]
ADC Host
Computational Aspects of MRI
Continuous and Discrete, Forward and Reverse Fourier Transforms
dxexhfH ifx∫∞
∞−= π2)()( dfefHxh ifx
∫∞
∞−
−= π2)()(
fk πω 2==
∑=
−−−=N
j
NkjiejhkH1
/)1)(1(2)()( π∑=
−−+=N
k
NkjiekHN
jh1
/)1)(1(2)(1)( π
Definitions of forward and reverse vary – just be consistent.
Note 1/N scale factor in only one of the Discrete FTs.
Angular frequency
Computational Aspects of MRI
Discretely Sampled Data: Pixels and FOV
fΔ≈ 2
1Δ− 2
1 0
Δ pixel
ΔN Δ1
FOV
ΔN1
⇔
Computational Aspects of MRI
Fourier Transform Pairs
k-space constant offset
Computational Aspects of MRI
Fourier Transform Pairs
For a rect that just covers the image FOV, the sinc will go through 0 at the k-space sample points.
Computational Aspects of MRI
Fourier Transform Pairs
FT of a series of spikes is another set of spikes with reciprocal spacing
Computational Aspects of MRI
Fourier Transform Pairs
Kaiser-Bessel. Fourier behaviour has analytic expression
Computational Aspects of MRI
Fourier Transform Relations
[ ]ifbfHbxhafH
aaxh
fHxh
π2exp)()(
1)(
)()(
⇔+
⎟⎠⎞
⎜⎝⎛⇔
⇔
scaling
shifting
convolution)()( fHfG⇔∫∞
∞−−≡∗ τττ dxhghg )()( ⊗
Rotation in one domain is a rotation by the same angle in the Fourier domain
Computational Aspects of MRI
Motion During an MRI scanRotation example
Time
Linear profile order
Rotation mid-way through scan.
Ghosting in PE direction.
Computational Aspects of MRI
Convolutionrect spike
∫∞
∞−−≡∗ τττ dxhghg )()(
x
⊗
x x
Computational Aspects of MRI
Convolutionrect rect
∫∞
∞−−≡∗ τττ dxhghg )()(
x
⊗
Computational Aspects of MRI
Convolutionrect gaussian
∫∞
∞−−≡∗ τττ dxhghg )()(
x
⊗
x
Computational Aspects of MRI
Image Filtering
• Low pass filter passes low frequencies.– Commonly used for noise reduction.
• High pass filter passes high frequencies.– e.g. separate cardiac from respiratory signal.
• Filtering (k-space multiplication) is equivalent to convolution in the image domain.
Computational Aspects of MRI
Filtering and Convolution
⊗
x
Computational Aspects of MRI
Discrete Sampling
continuous object
FT of sampling pattern
periodic replication
⊗
continuous k-space
discrete sampling
sampledk-space×
Computational Aspects of MRI
Discrete Sampling: Aliasing
continuous object
FT of sampling pattern
periodic replicationaliasing
⊗
continuous k-space
wider discrete sampling
sampledk-space×
Computational Aspects of MRI
image sampled every 8th pixel
Computational Aspects of MRI
Aliasing cont.
• Too wide a sampling pattern in k-space leads to image aliasing: MR image wrap around.
• Too widely separated pixels in a digital camera leads to spatial frequency aliasing: Image is not wrapped but has features with wrong spatial frequencies.
• Anti-aliasing filters are effective but must be used BEFORE digitisation.
Computational Aspects of MRI
Original
Cubic interpolation to 1/8 size,with anti-aliasing
Cubic interpolation to 1/8 size,without anti-aliasing
imshow(imresize(x,0.125,'Method','cubic','Antialiasing',true))
Computational Aspects of MRI
Sampling Theory
• The values of a function between samples can be recovered exactly, if,– function is band-limited – sampled at or above the Nyquist rate.
• The Nyquist rate is twice the highest frequency in the signal.– (The sampling needs to catch the up and down of a
sine wave.)• “Band-limited” means its Fourier Transform goes
to zero at the edges.
Computational Aspects of MRI
f Δ≈ 21
Δ− 21 0
Δ pixel
ΔN Δ1
FOVΔN
1
⇔
Band-limited: continuous frequencies assumed zero outside range shown
Nyquist rate is ΔN1
2/Δ− N 2/Δ+≈ N
Computational Aspects of MRI
Is MRI Data Band-Limited?
• In theory data cannot be band-limited in both image and k-space domains.
• For full FOV, raw, unchopped data the k-space is band-limited if there is no image wrap. The image is often effectively band-limited as the k-space signal falls into the noise.
Computational Aspects of MRI
Truncation Artefacts
When the object is not band-limited, we have to truncate the frequencies.– truncation– multiply frequencies by a rect– convolve image with a sinc– image ringing
Computational Aspects of MRI
Truncation
Gibbs effect. Ripples narrow but never disappear.
Computational Aspects of MRI
Use of Hermitian Symmetry
• The k-space of a real object (no imaginary component) is Hermitian symmetric.
• Used in the “half Fourier” MRI acquisitions. Note in reality object has non-zero phase and a phase correction is applied.
• Scan times ~5/8 of whole data achieved.
),(),( *yxyx kkSkkS −−=
Computational Aspects of MRI
The Fast Fourier Transform Algorithm
• Revolutionised signal processing.• Performs the FT on discrete data.• Requires data to be regularly sampled.• A number of practical issues…
Computational Aspects of MRI
FT of a Gaussian is …?
Computational Aspects of MRI
Discrete FT is periodic
“Expect” to seeRead The Manual
Computational Aspects of MRI
FFT Algorithm
• Pay attention to (i.e. read the manual):– Scaling.– Forward/inverse definitions.– Location of zero frequency (DC).
• MATLAB for N even: DC at N/2 + 1• MATLAB for N odd: DC at (N+1)/2
– Shifting• MATLAB: Apply ifftshift, then FFT or iFFT, then fftshift
– Dimensions over which to apply FT – through slice?
Computational Aspects of MRI
Complex nature of Fourier Coefficients
• Always use complex numbers when dealing with FFT.
• Pass through without special care.• Take modulus, phase etc at the end.
Computational Aspects of MRI
Interpolation
• Finding the value of a function between measured points.
x
?
a
Computational Aspects of MRI
Interpolation Approaches
1. Fit a polynomial-type function to all the data points. Function values between points can be computed.
• not well suited to images with many pixels.2. Repeatedly fit within local regions.3. Use sampling theory.
Computational Aspects of MRI
Local Interpolations
• Nearest neighbour• Linear• Cubic
x
?
Computational Aspects of MRI
Local Interpolations
• Nearest neighbour• Linear• Cubic
x
?
Computational Aspects of MRI
Local Interpolations
• Nearest neighbour• Linear• Cubic
x
?
[schematic]
Computational Aspects of MRI
Interpolation and Convolution
x
?
Nearest neighbour interpolation is equivalent to convolution with a rectangle.
d
d
Computational Aspects of MRI
Interpolation and Convolution
x
Linear interpolation is equivalent to convolution with a triangle.
a b c
kernelion interpolatr triangula theis where kkfkff ccaab +≈
af
cf
bf
Computational Aspects of MRI
Effect of convolution
• Convolution in image domain is multiplication by FT of kernel in k-space i.e. a low pass filtering or blurring.
Computational Aspects of MRI
Computational Aspects of MRI
Link to Sampling Theory
• A sinc kernel has a k-space filter that is a rect• For a band-limited image, multiplication of k-
space by a rect does no damage to k-space or the image.
• A band-limited function can be interpolated at any point exactly by sinc interpolation if it was sampled at the Nyquist rate.
• But, a sinc kernel has infinite extent…
Computational Aspects of MRI
Sinc Interpolation Kernel
x
?
xxx sinsinc =
Computational Aspects of MRI
• Smaller kernels: faster interpolation, more blurry results.• Interpolation error can oscillate with a period of 1 pixel.• In iterative algorithms e.g. registration, sometimes use
linear interpolation during the algorithm and a larger kernel for final display.
• Sinc interpolation for a rigid shift can be implemented by applying a phase ramp in the Fourier domain.
• For a fixed kernel applied across the data, can perform a de-apodisation
Computational Aspects of MRI
Gridding
Gridding, or “re-gridding”, maps irregularly sampled data to a regular grid.
• The FFT requires regularly sampled data as input.• Motion during a single scan can put data off a regular grid.• Non-Cartesian k-space trajectory, e.g. radial, spiral
Gridding Methods• MATLAB function griddata• Convolution re-gridding (interpolation)• Non-uniform FFT (nuFFT)
Computational Aspects of MRI
MATLAB griddata
• Delauney triangulation of irregular points.• Triangular interpolation using the
measured values at the triangle vertices.
Computational Aspects of MRI
Convolution Re-gridding(recap on interpolation)
xa b c
af
cf
bf
Linear interpolation of regularly sampled data: convolution with a triangle kernel centred at the position b where we wish to evaluate the function.
ccaab kfkff +≈
Computational Aspects of MRI
Convolution Re-gridding(irregular samples)
x
Apply a sampling density correction.Centre the kernel at each regular grid point.Compute convolution.
De-apodise.
Computational Aspects of MRI
De-apodisation
• In convolution re-gridding, the k-space has been convolved with a kernel.
• Equivalently, the image has been multiplied by the FT of the kernel.– bright in image centre
• Divide image by FT of kernel to de-apodise.– beware of zeros.
Computational Aspects of MRI
Other gridding issues
• The kernel is often chosen to be a Kaiser Bessel.
• The grid may be “oversampled” – finer k-space resolution, chop doubled FOV after processing.
• Convolution is in 2D.• Sampling density correction is non-trivial
for general sampling pattern.
Computational Aspects of MRI
Discrete Fourier Transform of Non-Uniform Data
• The Discrete Fourier Transform can be computed by summation - data still needs to be sampling density corrected O(N2).
• Non-uniform Fast Fourier Transform uses oversampled grid and FFT to achieve speed O(mNlogN).
Computational Aspects of MRI
Summary
• FT is linear.• Discrete sampling raises issues of
aliasing, gridding etc.
• Useful to think about issues in both image and k-space domains.
Computational Aspects of MRI
Computational Aspects of MRI
Interpolation in MATLAB
• griddata – scattered data• imresize – image resizing with anti-
aliasing.• interp2, interpn – 2D and nD
interpolation.• imtransform – apply geometrical
transform• makeresampler – user specified
interpolation for imtransform