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

Blobs and sinograms: added pitching, to possibly allow for fast memory access

parent fce64e34
No related branches found
No related tags found
No related merge requests found
......@@ -389,10 +389,10 @@ classdef Gt6DReconstructionAlgorithmFactory < handle
end
function algo_params = get_algorithm_params(self, sampler, blobs_w_interp, shape_funcs)
fprintf('Extracting blobs on detector: ')
fprintf('Extracting and pitching blobs on detector: ')
c = tic();
sel_bls = sampler.selected;
bl = sampler.bl(sel_bls);
bl = self.pitch_blobs(sampler.bl, sel_bls);
fprintf('\b\b (%f s).\n', toc(c));
tot_blobs = numel(bl);
sel_incl_indx = find(sel_bls);
......@@ -578,6 +578,23 @@ classdef Gt6DReconstructionAlgorithmFactory < handle
end
end
function bls = pitch_blobs(self, bls, selected)
bls = bls(selected);
switch (self.data_type)
case 'single'
data_size = 4;
case 'double'
data_size = 2;
end
for ii_b = 1:numel(bls)
padding = mod(data_size - mod(bls(ii_b).bbsize(1), data_size), data_size);
bls(ii_b).intm = padarray(bls(ii_b).intm, [padding, 0, 0], 0, 'post');
bls(ii_b).bbsize(1) = bls(ii_b).bbsize(1) + padding;
end
end
function pad_interp_blobs = pad_blobs(self, blobs, paddings, slices_interp)
num_blobs = numel(blobs);
pad_interp_blobs = cell(num_blobs, 1);
......
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