-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbackProject.m
More file actions
35 lines (27 loc) · 999 Bytes
/
backProject.m
File metadata and controls
35 lines (27 loc) · 999 Bytes
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
function out = backProject( sino, projAngles, sImg )
% out = backProject( sino, projAngles, sImg )
%
% Inputs:
% sino - parallel beam sinogram
%
% Written by Nicholas Dwork, Copyright 2025
%
% This software is offered under the GNU General Public License 3.0. It
% is offered without any warranty expressed or implied, including the
% implied warranties of merchantability or fitness for a particular
% purpose.
if size( sino, 1 ) ~= sImg(1)
error( 'The first dimension of sino must be the number of rows in the image' );
end
if size( sino, 2 ) ~= numel( projAngles )
error( 'The second dimension of sino must be the same as the number of projection angles' );
end
out = zeros( sImg );
for angleIndx = 1 : numel( projAngles )
projAngle = projAngles( angleIndx ) * 180/pi;
proj = repmat( sino(:,angleIndx), [ 1 sImg(2) ] );
proj = imrotate( proj, -projAngle, 'loose' );
proj = cropData( proj, sImg );
out = out + proj;
end
end