Skip to content
Snippets Groups Projects
Commit 0f85552a authored by Nicola Vigano's avatar Nicola Vigano Committed by Nicola Vigano
Browse files

Added some commented example code to perform convolution with FFT.

parent 6b1d015d
No related branches found
No related tags found
No related merge requests found
......@@ -246,6 +246,36 @@ classdef Gt6DVolumeToBlobProjector < Gt6DVolumeProjector
sino = permute(sino, [1 3 2]);
% % Example of same code, but using FFT
% padded_size = slice_size + sizes_shape_funcs(1:2) - 1;
% shifts_sf = [round((padded_size - sizes_shape_funcs(1:2)) / 2), 0];
%
% padded_sino = zeros([padded_size, size(sino, 3)], 'like', sino);
% shifts_sino = [round((padded_size - slice_size) / 2), 0];
% padded_sino = gtPlaceSubVolume(padded_sino, sino, shifts_sino);
% padded_sino = fft2(padded_sino);
%
% cumul_pos = 0;
% for ii_b = 1:numel(shape_funcs)
% bl = shape_funcs(ii_b);
% padded_intm = zeros([padded_size, bl.bbsize(3)], 'like', bl.intm);
% padded_intm = gtPlaceSubVolume(padded_intm, bl.intm, shifts_sf);
% padded_intm = fft2(padded_intm);
%
% temp_mult = padded_sino(:, :, ii_b * ones(shape_funcs(ii_b).bbsize(3), 1)) .* padded_intm;
% temp_mult = ifft2(temp_mult);
% inds_u_temp_mult = shifts_sino(1) + (1:slice_size(1));
% inds_v_temp_mult = shifts_sino(2) + (1:slice_size(2));
% temp_mult = temp_mult(inds_u_temp_mult, inds_v_temp_mult, :);
% temp_mult = fftshift(real(temp_mult), 1);
% temp_mult = fftshift(temp_mult, 2);
%
% inds_sino_sf = cumul_pos+(1:shape_funcs(ii_b).bbsize(3));
% sino_sf(:, inds_sino_sf, :) = permute(temp_mult, [1 3 2]);
%
% cumul_pos = cumul_pos + shape_funcs(ii_b).bbsize(3);
% end
cumul_pos = 0;
for ii_b = 1:numel(shape_funcs)
sino_slice = sino(:, :, ii_b);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment