From 74cfcdf44775651290503251004c54f227e35250 Mon Sep 17 00:00:00 2001 From: Kris Thielemans Date: Thu, 16 May 2024 01:14:14 +0100 Subject: [PATCH] fix set_up of norm in TOF ProjData gradient Due to my misunderstanding (and some wrong comments) of the meaning of `add_sensitivity`, we did not set-up the normalisation object when computing the gradient. Fixes #1431 --- ...oissonLogLikelihoodWithLinearModelForMeanAndProjData.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/recon_buildblock/PoissonLogLikelihoodWithLinearModelForMeanAndProjData.cxx b/src/recon_buildblock/PoissonLogLikelihoodWithLinearModelForMeanAndProjData.cxx index 8c634e500..7de49607d 100644 --- a/src/recon_buildblock/PoissonLogLikelihoodWithLinearModelForMeanAndProjData.cxx +++ b/src/recon_buildblock/PoissonLogLikelihoodWithLinearModelForMeanAndProjData.cxx @@ -706,7 +706,7 @@ PoissonLogLikelihoodWithLinearModelForMeanAndProjData::actual_compute_s if (!this->distributable_computation_already_setup) error("PoissonLogLikelihoodWithLinearModelForMeanAndProjData internal error: setup_distributable_computation not called " "(gradient calculation)"); - if (add_sensitivity) + if (!add_sensitivity) this->ensure_norm_is_set_up(); distributable_compute_gradient(this->projector_pair_ptr->get_forward_projector_sptr(), this->projector_pair_ptr->get_back_projector_sptr(), @@ -1225,7 +1225,7 @@ distributable_compute_gradient(const shared_ptr& forward_ { if (add_sensitivity) { - // Within the RPC process, subtract ones before to back projection ( backproj[ y/ybar - 1] ) + // Within the RPC process, only do div/truncate ( backproj[ y/ybar ] ) distributable_computation(forward_projector_sptr, back_projector_sptr, symmetries_sptr, @@ -1250,7 +1250,7 @@ distributable_compute_gradient(const shared_ptr& forward_ } else if (!add_sensitivity) { - // Within the RPC process, only do div/truncate ( backproj[ y/ybar ] ) + // Within the RPC process, subtract ones before to back projection ( backproj[ y/ybar - eff*1] ) distributable_computation(forward_projector_sptr, back_projector_sptr, symmetries_sptr,