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

6D-reconstruction: small fixes

parent 52d09aba
No related branches found
No related tags found
No related merge requests found
......@@ -567,6 +567,7 @@ classdef Gt6DBlobReconstructor < Gt6DVolumeToBlobProjector
proj_bls = cell(num_det, 1);
renorm_factors = self.detector_ss .^ 2;
do_renorm = abs(renorm_factors - 1) > eps('single');
for ii_d = 1:num_det
c = tic();
......@@ -587,7 +588,7 @@ classdef Gt6DBlobReconstructor < Gt6DVolumeToBlobProjector
timing_sb = timing_sb + sb_time;
end
if (renorm_factors(ii_d) ~= 1)
if (do_renorm(ii_d))
c = tic();
for ii_b = 1:numel(proj_bls{ii_d})
proj_bls{ii_d}{ii_b} = proj_bls{ii_d}{ii_b} * renorm_factors(ii_d);
......@@ -600,7 +601,9 @@ classdef Gt6DBlobReconstructor < Gt6DVolumeToBlobProjector
self.statistics.add_timestamp(timing_fp, 'cp_dual_update_detector', 'cp_dual_detector_FP');
self.statistics.add_timestamp(timing_sb, 'cp_dual_update_detector', 'cp_dual_detector_SB');
self.statistics.add_timestamp(timing_in, 'cp_dual_update_detector', 'cp_dual_detector_IN');
self.statistics.add_timestamp(timing_rs, 'cp_dual_update_detector', 'cp_dual_detector_RS');
if (any(do_renorm))
self.statistics.add_timestamp(timing_rs, 'cp_dual_update_detector', 'cp_dual_detector_RS');
end
end
end
......@@ -615,6 +618,7 @@ classdef Gt6DBlobReconstructor < Gt6DVolumeToBlobProjector
num_geoms = self.get_number_geometries();
renorm_factors = 1 ./ (self.detector_ss .^ 2);
do_renorm = abs(renorm_factors - 1) > eps('single');
num_det = self.get_number_detectors();
for n = 1:chunk_size:num_geoms
......@@ -627,7 +631,7 @@ classdef Gt6DBlobReconstructor < Gt6DVolumeToBlobProjector
timing_bp = timing_bp + bp_time;
timing_bs = timing_bs + bs_time;
if (renorm_factors(ii_d) ~= 1)
if (do_renorm(ii_d))
c = tic();
v(:, ii_d) = gtCxxMathsCellTimes(v(:, ii_d), renorm_factors(ii_d), 'threads', self.num_threads, 'copy', false);
timing_rs = timing_rs + toc(c);
......@@ -654,7 +658,9 @@ classdef Gt6DBlobReconstructor < Gt6DVolumeToBlobProjector
self.statistics.add_timestamp(timing_bs, 'cp_primal_update', 'cp_primal_BS')
self.statistics.add_timestamp(timing_corr, 'cp_primal_update', 'cp_primal_CORR')
self.statistics.add_timestamp(timing_app, 'cp_primal_update', 'cp_primal_APP')
self.statistics.add_timestamp(timing_rs, 'cp_primal_update', 'cp_primal_RS')
if (any(do_renorm))
self.statistics.add_timestamp(timing_rs, 'cp_primal_update', 'cp_primal_RS')
end
end
end
......@@ -668,7 +674,6 @@ classdef Gt6DBlobReconstructor < Gt6DVolumeToBlobProjector
vols_ones = cell(size(self.currentSolution));
vols_ones(:) = {ones(self.volume_geometry, self.data_type)};
self.fwd_weights = self.compute_fwd_projection(vols_ones, false);
% self.fwd_weights = self.getRowsSum();
self.fwd_weights = self.apply_psf(self.fwd_weights, true);
for ii_d = 1:num_det
for ii_b = 1:numel(self.fwd_weights)
......@@ -699,7 +704,9 @@ classdef Gt6DBlobReconstructor < Gt6DVolumeToBlobProjector
for ii_d = 1:num_det
sigma1{ii_d} = cell(size(self.fwd_weights{ii_d}));
for n = 1:numel(sigma1{ii_d})
sigma1{ii_d}{n} = 1 ./ (self.fwd_weights{ii_d}{n} + (self.fwd_weights{ii_d}{n} == 0));
% Necessary in case of use of OTF
tol = eps('single') * max(self.fwd_weights{ii_d}{n}(:));
sigma1{ii_d}{n} = 1 ./ (self.fwd_weights{ii_d}{n} + (self.fwd_weights{ii_d}{n} < tol));
end
sigma1_1{ii_d} = sigma1{ii_d};
......
......@@ -55,7 +55,6 @@ function proj_geom = gtGeoProjForReconstruction(projvec_sam, omega, vol_center,.
detgeo = gtGeoConvertLegacyLabgeo2Detgeo(labgeo);
end
% Bounding box center U,V coordinates
bbcent_det = [ ...
bbpos(:, 1) + (bbpos(:, 3) - 1) / 2 + bboff(:, 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