Skip to content

Commit

Permalink
Fix FDK option usegpufft option not working
Browse files Browse the repository at this point in the history
  • Loading branch information
tsadakane committed Feb 2, 2023
1 parent b1f31ea commit bb7e0d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion MATLAB/Algorithms/FDK.m
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
proj(:,:,ii) = w.*proj(:,:,ii);
end
%% Fourier transform based filtering
proj = filtering(proj,geo,angles,parker); % Not sure if offsets are good in here
proj = filtering(proj,geo,angles,parker, 'usegpufft', usegpufft); % Not sure if offsets are good in here

% RMFIELD Remove fields from a structure array.
geo=rmfield(geo,'filter');
Expand Down
12 changes: 7 additions & 5 deletions MATLAB/Utilities/filtering.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,13 @@
fproj = (zeros(filt_len,geo.nDetector(2),'single'));

fproj(round(filt_len/2-geo.nDetector(1)/2+1):round(filt_len/2+geo.nDetector(1)/2),:) = proj(:,:,ii);

fproj = fft(fproj);
fproj = fproj.*filt;
fproj = (real(ifft(fproj)));

if usegpufft==1
fproj = ApplyFbpFiltration(fproj, filt, gpuids);
else
fproj = fft(fproj);
fproj = fproj.*filt;
fproj = (real(ifft(fproj)));
end
if parker
proj(:,:,ii) = fproj(round(end/2-geo.nDetector(1)/2+1):round(end/2+geo.nDetector(1)/2),:)/2/geo.dDetector(1)*(2*pi/ (pi/angle_step) )/2*(geo.DSD(ii)/geo.DSO(ii));
else
Expand Down

0 comments on commit bb7e0d7

Please sign in to comment.