12 Image Reconstruction

Embed Size (px)

Citation preview

  • 7/31/2019 12 Image Reconstruction

    1/20

    10/19/20

    1

    ENGG 167

    MEDICAL IMAGING

    Lecture 12: Friday, Oct. 19

    Image Reconstruction from Projections

    Reference: Chapters 12 & 13, The Essential Physics of Medical Imaging , Bushberg

    Computed Tomography, Kalender, Verlag, 2000.

    Chapter 12, Intermediate Physics for Medicine and Biology, 3 rd Ed., Hobbie.

    Chapter 3, Principles of Computerized Tomographic Imaging, Kak and Slaney,

    IEEE Press

    Medical Physics and Biomedical Engineering, Brown, et al, IoP Publishing.

    2

    Image Reconstruction

    Ref: Hobbie

    1) 2-D Fourier transform review

    2) Filtering in space and frequency domain

    2) Backprojection

    3) Filtered Backprojection

  • 7/31/2019 12 Image Reconstruction

    2/20

    10/19/20

    3

    1) Basics Fourier Transform of an image f(x,y)

    Ref: Hobbie

    Fourier amplitude

    Real space

    Transformed image is described in k-space,where kx= 2/x, ky=2/y are spatial frequencies

    4

    1) What does the DFT image represent ?

    Ref: Hobbie

    Highest Frequencies

    kx,max = (Nx/Sx) = 1/[2(pixel width)]

    ky,max = (Ny/Sy)

    lowest frequencies

    kx,min = 1/Sxky,min = 1/Sy

    S size of image (mm)

    N number of pixels

    Maximal negative frequency

    kx,max = - (Nx/Sx) = -1/[2(pixel width)]

    ky,max = - (Ny/Sy)

  • 7/31/2019 12 Image Reconstruction

    3/20

    10/19/20

    5

    2) Fourier Slice Theorem example

    F=imread('abdomen visible human gray.jpg');

    imagesc((F));colorbar; colormap('bone');

    X=abs(fft2(F));imagesc(log(X(:,:,1)));colorbar;colormap('bone');

    X=abs(fft2(F));imagesc(fftshift(log(X(:,:,1))));colorbar;colormap('bone'); P=angle(fft2(F));imagesc(fftshift(P(:,:,1)));colorbar

    X=abs(fft2(F));imagesc((X(:,:,1)));colorbar;colormap('bone');

    Note DFT has

    same number of

    pixels, but two images

    magnitude and phase

    6

    3) Fourier Transform of an image f(x,y) in MATLAB

    F=imread('kpaulsen.jpg');imagesc((F));colorbar

    X=abs(fft2(F));imagesc( fftshift(log(X(:,:,1))));colorbar

    P=angle(fft2(F));imagesc( fftshift(P(:,:,1)));colorbar

    X=abs(fft2(F));imagesc(log(X(:,:,1)));colorbar

    P=angle(fft2(F));imagesc(P(:,:,1));colorbar

    K-space image with

    K=0 at center

    Note DFT

    image has both

    amplitude

    and phase

    information

  • 7/31/2019 12 Image Reconstruction

    4/20

    10/19/20

    7

    1) Review: Fourier Transform of an image f(x,y) in MATLAB

    A=fft2(F);F1=uint8(abs(fft2(A./20500)));

    F2=imrotate(F1,180);imagesc(F2)

    8

    2) Filtering space domain convolution

    Convolution integral

    g(x) = filtered data

    g(x) = initial data

    h(x-x) = filter function

    '( ) ( ') ( ') 'g x g x h x x dx

    =

    '( ) ( ) ( )g x g x h x=

    g=[1 3 4 2 3 5 6 7 8 9 5 6 7 8 9 7 5 4 3 2 3 2 4 2 1 1 1 ];

    plot(g);

    h=[1 2 1];

    gp=conv(g,h);Figure; plot(gp)

    [1 2 1] =

    h=[.25 .5 .25];

    gp=conv(g,h);

    plot(gp)

    [0.25 0.5 0.25] =

    smoothing

    filter

  • 7/31/2019 12 Image Reconstruction

    5/20

    10/19/20

    9

    2) Filtering space domain convolution

    Convolution integral

    g(x) = filtered datag(x) = initial data

    h(x-x) = filter function

    '( ) ( ') ( ') 'g x g x h x x dx

    =

    '( ) ( ) ( )g x g x h x=

    g=[1 3 4 2 3 5 6 7 8 9

    5 6 7 8 9 7 5 4 3 2

    3 2 4 2 1 1 1 ];

    plot(g);

    h=[1 2 1];

    gp=conv(g,h);

    Figure; plot(gp)

    =

    [-1 2 -1]

    =

    =[-1 2 -1]

    [-1 4 -1]

    g=[1 2 2 2 2 7 7 7

    7 7 7 7 7 4 4 4

    4 4 2 2 2 2 2 2 2 2 1 ];

    plot(g)

    gp=conv(g,h);

    plot(gp)

    h=[-1 4 -1];gp=conv(g,h);

    plot(gp)

    10

    2) Filtering of Images space domain

    Convolution integral

    g(x,y) = image

    f(x,y) = test object

    h(x-x,y-y) = filter function

    '( , ) ( ', ') ( ', ') ' 'g x y g x y h x x y y dx dy

    =

    '( , ) ( , ) ( , )g x y g x y h x y=

    1 2 1

    2 4 2

    1 2 1=

    h = fspecial(type,parameters) - predefined filters of any shape

    X=imread('happyface.jpg');

    imagesc(X);

    B=[1 2 1; 2 4 2; 1 2 1];

    Y=conv2(X,B);

    Imagesc(Y);colormap(bone);

    -1 -2 -1

    -2 8 -2

    -1 -2 -1

    =

    1 1 1

    0 0 0

    -1 -1 -1=

    imagesc(X);

    B=[-1 -2 -1; -2 8 -2; -1 -2 -1];

    Y=conv2(X,B);

    Imagesc(Y);colormap(bone);

    imagesc(X);

    B=[1 2 1; 0 0 0; -1 -1 -1];

    Y=conv2(X,B);

    Imagesc(Y);colormap(bone);

    Prewitt Filter

  • 7/31/2019 12 Image Reconstruction

    6/20

    10/19/20

    11

    2) Filtering of Images frequency domain

    '( , ) ( , ) ( , )g x y g x y h x y=

    '( , ) ( , ) ( , )x y x y x y

    g k k g k k h k k =

    The Fourier transform of a

    convolution is the multiplicationof the transformed functions

    1 2 1

    2 4 2

    1 2 1=

    X=imread('happyface.jpg');

    imagesc(X);

    B=[1 2 1; 2 4 2; 1 2 1];

    Y=conv2(X,B);

    Imagesc(Y);colormap(bone);

    '( ) ( ') ( ') 'g x g x h x x dx

    = '( ) ( ) ( )g x g x h x=

    '( ) ( ) ( )x x xg k g k h k =

    This is also true in 2-D (images)

    X =

    FFT2 FFT2 FFT2

    12

    3) Image Reconstruction : projection data

    Ref: Kalendar

  • 7/31/2019 12 Image Reconstruction

    7/20

    10/19/20

    13

    3) Backprojection - Linear single backprojection

    SourceDetector

    Source

    Detectorinverse = 1 back projection

    14

    3) Backprojection two linear projections

    Source

    Detector 2

    Source

    Detector 1+

    Detector 1

    Detector 2

  • 7/31/2019 12 Image Reconstruction

    8/20

    10/19/20

    15

    3) Backprojection Multiple linear projections

    3 projections 4 projections many projections

    Originalobject

    16

    3) Image Reconstruction concept of backprojection

    Ref: Bushberg

  • 7/31/2019 12 Image Reconstruction

    9/20

    10/19/20

    17

    3) Image Reconstruction Algebraic ReconstructionTechnique (ART)

    Ref: Bushberg

    A

    B

    C

    D

    1 1 0 0

    1 0 1 0

    1 0 0 1

    0 1 1 0

    0 1 0 1

    0 0 1 1

    =

    7

    6

    5

    9

    8

    7

    K x = b

    KTK x = KTb

    x = [KTK]-1 KTb

    Over-determined non-square matrix K

    Multiply by KT first

    Invert square matrix

    Larger problems must be solved iterativelyusing standard methods for solving large

    matrix operation problems.

    18

    3) Relating to x-y coordinate back-projection

    Ref: Hobbie

  • 7/31/2019 12 Image Reconstruction

    10/20

    10/19/20

    19

    3) Filtered Backprojection - parallel and cone beams

    Ref: Kak and Slaney

    Optional Read through equations from Chapter 3in book by Kak and Slaney.

    Available on the web at:http://rvl4.ecn.purdue.edu/~malcolm/pct/pct-toc.html

    20

    3) The Radon Transform Kak and Slaney

    Ref: Kak and Slaney

  • 7/31/2019 12 Image Reconstruction

    11/20

    10/19/20

    21

    3) Fourier Slice Theorem Kak and Slaney

    Ref: Kak and Slaney

    22

    3) Fourier Slice Theorem Kak and Slaney

    Ref: Kak and Slaney

  • 7/31/2019 12 Image Reconstruction

    12/20

    10/19/20

    23

    2) Fourier Slice Theorem what does the DFT image represent ?

    Ref: Hobbie

    Projectionprofile

    Integrate intensities

    along x-direction

    1-D

    DFT

    DFT of

    projection

    profile

    Creates line

    Central slice of

    Entire DFT image

    24

    2) Fourier Slice Theorem what does the DFT image represent ?

    Ref: Hobbie

    Projection

    profiles

    Integrate intensities

    along x-direction

    1-D

    DFTs

    Create lines in

    central slice of

    entire DFT image

    The more angles

    used, the better

    the Fourier space

    image is filled

  • 7/31/2019 12 Image Reconstruction

    13/20

    10/19/20

    25

    2) Fourier Slice Theorem what does the DFT image represent ?

    Ref: Hobbie

    1-D

    DFTs

    at each

    projection

    DFT image represents integration of

    original projections DFT transformed and

    summed together.

    This is the fast way to create the DFT

    image from projection data. The moreprojections taken, the more complete the

    sampling.

    26

    3) Radon Transform sinogram data backprojection

    Ref: Brown et al.

  • 7/31/2019 12 Image Reconstruction

    14/20

    10/19/20

    27

    3) Backprojection of Radon Transform

    Ref: Brown et al.

    28

    3) Backprojection filtering required to bring out high

    Ref: Brown et al.

  • 7/31/2019 12 Image Reconstruction

    15/20

    10/19/20

    29

    3) Image Reconstruction - concept ofbackprojection and filtered backprojection

    Ref: Bushberg

    30

    3) Reconstruction

    Ref: Kalendar

  • 7/31/2019 12 Image Reconstruction

    16/20

    10/19/20

    31

    3) Parallel Beams and Fan Beams

    Ref: Kak and Slaney

    Chapter 3 in book by Kak and Slaney.

    http://rvl4.ecn.purdue.edu/~malcolm/pct/pct-toc.html

    32

    Filtered Backprojection - Review

  • 7/31/2019 12 Image Reconstruction

    17/20

    10/19/20

    33

    34

    MATLAB implementation of a test phantom

    Ref: Matlab Help Guide

    P = phantom('Modified Shepp-Logan',200); imshow(P)

    Shepp-Logan phantom is a standard head CT simulation.

    Described in detail in Kak & Slaney, pg 102.

  • 7/31/2019 12 Image Reconstruction

    18/20

    10/19/20

    35

    MATLAB implementation of the Radon transform (i.e. projection data)

    Ref: Matlab Help Guide

    Imaging a square

    iptsetpref('ImshowAxesVisible','on')

    I = zeros(100,100);

    I(25:75,25:75) = 1;

    theta = 0:180;

    [RI,xp] = radon(I,theta);

    imshow(theta,xp,RI,[],'notruesize'), colormap(bone), colorbar

    R = radon(I,theta)If you omit theta, it defaults to 0:179.

    Imaging the Modified Shepp-Logan phantom

    P = phantom('Modified Shepp-Logan',200); imshow(P)

    [RP,xp] = radon(P,theta);

    imshow(theta,xp,RP,[],'notruesize'), colormap(bone), colorbar

    36

    MATLAB implementation of the Inverse Radon transform

    (i.e. image reconstruction from projection data)

    Ref: Matlab Help Guide

    I = iradon(P,theta)

    I = iradon(P,theta,interp,filter,d,n)

    interp specifies the type of interpolation to use in the backprojection. The available options are listed in order of

    increasing accuracy and computational complexity:

    'nearest' - nearest neighbor interpolation

    'linear' - linear interpolation (default)

    'spline' - spline interpolation

    filter specifies the filter to use for frequency domain filtering. filter is a string that specifies any of the following

    standard filters:

    'Ram-Lak' - The cropped Ram-Lakor ramp filter (default). The frequency response of this filter is | f |. Because this

    filter is sensitive to noise in the projections, one of the filters listed below may be preferable. These filters multiply

    the Ram-Lak filter by a window that de-emphasizes high frequencies.

    'Shepp-Logan' - The Shepp-Logan filter multiplies the Ram-Lak filter by a sinc function.

    'Cosine' - The cosine filter multiplies the Ram-Lak filter by a cosine function.

    'Hamming' - The Hamming filter multiplies the Ram-Lak filter by a Hamming window.

    'Hann' - The Hann filter multiplies the Ram-Lak filter by a Hann window.

    d is a scalar in the range (0,1] that modifies the filter by rescaling its frequency axis. The default is 1. If d is less than

    1, the filter is compressed to fit into the frequency range [0,d], in normalized frequencies; all frequencies above d are

    set to 0.

    n is a scalar that specifies the number of rows and columns in the reconstructed image. If n is not specified, the size is

    determined from the length of the projections.

    n = 2*floor(size(P,1)/(2*sqrt(2)))

  • 7/31/2019 12 Image Reconstruction

    19/20

    10/19/20

    37

    MATLAB implementation of the Inverse Radon transform(i.e. image reconstruction from projection data)

    Ref: Matlab Help Guide

    I = iradon(P,theta)I = iradon(P,theta,interp,filter,d,n)

    KI = iradon(PI,theta)

    imshow(theta,xp,KI,[],'notruesize'), colormap(bone), colorbar

    KP = iradon(P,theta)

    imshow(theta,xp,KP,[],'notruesize'), colormap(bone), colorbar

    38

    Effect of projection number

    Ref: Matlab Help Guide

    P = phantom('Modified Shepp-Logan',200);[RP,xp] = radon(P,theta);KP = iradon(RP,theta);

    imshow(theta,xp,KP,[],'notruesize'), colormap(bone), colorbar

    theta = 0:40:170 theta = 0:20:170 theta = 0:10:170 theta = 0:1:170

  • 7/31/2019 12 Image Reconstruction

    20/20

    10/19/20

    39

    Effect of noise in the projection data

    Ref: Matlab Help Guide

    sd=0 sd=0.05 sd=0.10 sd=0.20 sd=0.50

    imshow(theta,xp,RN1,[],'notruesize'), colormap(jet), colorbar;

    P = phantom('Modified Shepp-Logan',200);

    [RP,xp] = radon(P,theta);

    RN1=RP.*(1+sd*randn(size(RP)));

    KP1 = iradon(RN1,theta);

    imshow(KP1), colormap(jet), colorbar