summaryrefslogtreecommitdiffstats
path: root/matlab/tools/astra_create_fbp_reconstruction.m
blob: a2561b7da3e01b36b5d059696d1f736055f580dd (plain)
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
function [FBP_id, FBP] = astra_create_fbp_reconstruction(sinogram, proj_id)

proj_geom = astra_mex_projector('projection_geometry', proj_id);
vol_geom = astra_mex_projector('volume_geometry', proj_id);

if numel(sinogram) == 1
	sinogram_id = sinogram;
else
	sinogram_id = astra_mex_data2d('create', '-sino', proj_geom, sinogram);
end

FBP_id = astra_mex_data2d('create','-vol',vol_geom, 0);

cfg = astra_struct('FBP_CUDA');
cfg.ProjectionDataId = sinogram_id;
cfg.ReconstructionDataId = FBP_id;
cfg.FilterType = 'Ram-Lak';
cfg.ProjectorId = proj_id;
cfg.Options.GPUindex = 0;
alg_id = astra_mex_algorithm('create', cfg);
astra_mex_algorithm('run', alg_id);
astra_mex_algorithm('delete', alg_id);

if numel(sinogram) ~= 1
	astra_mex_data2d('delete', sinogram_id);
end

FBP = astra_mex_data2d('get', FBP_id);