-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRWithTranslation.m
More file actions
28 lines (21 loc) · 794 Bytes
/
Copy pathRWithTranslation.m
File metadata and controls
28 lines (21 loc) · 794 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
function sinogram = RWithTranslation( img, translations_pix, nDet, RT )
% sinogram = RWithTranslation( img, translations_pix, nDet, R )
% nDet is the number of detectors
%[M,~] = size(R);
[~,M] = size(RT);
nThetas = M / nDet;
sinogram = zeros(nThetas,nDet);
[nTranslations,~] = size(translations_pix);
if nTranslations ~= nThetas, error('Input error'); end;
parfor th=1:nThetas
thisTrans_pix = translations_pix(th,:);
translated = translateImg( img, thisTrans_pix );
%tmpSino = R * translated(:);
%tmpSino = reshape( tmpSino, [nThetas nDet] );
%sinogram(th,:) = tmpSino(th,:);
indxs1D = th + ((1:nDet)-1)*nThetas;
results = RT(:,indxs1D)' * translated(:);
%results = R(indxs1D,:) * translated(:);
sinogram(th,:) = results;
end
end