/perf/fdk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/perf/fdk

« back to all changes in this revision

Viewing changes to run_fdk.m

  • Committer: Suren A. Chilingaryan
  • Date: 2017-02-08 19:08:48 UTC
  • Revision ID: csa@suren.me-20170208190848-lycd9dm701hyu608
Initial

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
clc;
 
2
clear all;
 
3
close all;
 
4
 
 
5
n_voxels = 2000;
 
6
n_proj = 3600;
 
7
r = 1060/16;
 
8
d = 1060;
 
9
detector_size = 400;
 
10
pix_size = 400/2000;
 
11
cor_offset = 0;
 
12
detector_offset_u = 0;
 
13
detector_offset_v = 0;
 
14
detector_offset_z = 0;
 
15
s = [0 0 0];
 
16
u_detector_r = [1 0 0];
 
17
v_detector_r = [0 1 0];
 
18
n_detector_r = [0 0 1];
 
19
proj_vol = zeros(n_voxels,n_voxels,n_proj);
 
20
 
 
21
x_o = (n_voxels+1)/2;
 
22
y_o = (n_voxels+1)/2;
 
23
z_o = (n_voxels+1)/2;
 
24
 
 
25
x_grid = (1:1:n_voxels)-x_o;
 
26
y_grid = (n_voxels:-1:1)-y_o;
 
27
z_grid = (1:1:n_voxels)-z_o;
 
28
 
 
29
vox_size = pix_size/16;
 
30
 
 
31
x_grid = single(x_grid*vox_size);
 
32
y_grid = single(y_grid*vox_size);
 
33
z_grid = single(z_grid*vox_size);
 
34
 
 
35
[slice_x,slice_y] = meshgrid(x_grid,y_grid);
 
36
 
 
37
n_threads = 1;
 
38
 
 
39
vol = fdk(int32(n_voxels),...
 
40
    int32(n_proj),...
 
41
    single(r),...
 
42
    single(d),...
 
43
    single(detector_size),...
 
44
    single(pix_size),...
 
45
    single(cor_offset),...
 
46
    single(detector_offset_u),...
 
47
    single(detector_offset_v),...
 
48
    single(detector_offset_z),...
 
49
    single(s),...
 
50
    single(u_detector_r),...
 
51
    single(v_detector_r),...
 
52
    single(n_detector_r),...
 
53
    single(proj_vol),...
 
54
    single(slice_x),...
 
55
    single(slice_y),...
 
56
    single(z_grid),...
 
57
    int32(n_threads));
 
 
b'\\ No newline at end of file'