-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathctTest.m
More file actions
executable file
·43 lines (31 loc) · 1.07 KB
/
Copy pathctTest.m
File metadata and controls
executable file
·43 lines (31 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
function ctTest
clear; close all;
im = phantom();
delta = 0.001;
figure( 'name', 'Original Image' );
imshow( im, [] );
type = 'fast';
nDetectors = 500;
dSize = 0.001;
dTheta = 1 * pi/180;
thetas = 0:dTheta:pi-dTheta;
sinogram = ctRadon( im, delta, nDetectors, dSize, thetas, type );
figure( 'name', 'sinogram' );
imshow( sinogram, [] );
% Reconstruction parameters
cx = 0; Nx=256; dx=delta;
cy = 0; Ny=256; dy=delta;
bp = ctBackProject( sinogram, thetas, dSize, cx, cy, Nx, Ny, ...
dx, dy, type );
figure( 'name', 'Back Projection' );
imshow( bp, [] );
recon = ctIRadon( sinogram, thetas, dSize, cx, cy, Nx, Ny, dx, dy, 'Hanning' );
figure( 'name', 'Reconstruction' );
imshow( recon, [] );
recon2DFT = ctIRadon2DFT( sinogram, thetas, dSize, cx, cy, Nx, Ny, dx, dy, 'none' );
figure( 'name', '2DFT Reconstruction' );
imshow( recon2DFT, [] );
sinogram2 = ctRadon( recon, delta, nDetectors, dSize, thetas );
figure( 'name', 'Sinogram 2' );
imshow( sinogram2, [] );
end