From 42340f2d6a3df4e1b41485d7c4fb2c8d5c7db526 Mon Sep 17 00:00:00 2001 From: robbietuk Date: Thu, 12 Sep 2024 13:10:52 -0700 Subject: [PATCH] Add additional test on efficiency values --- .../test_MLEstimateComponentBasedNormalisation.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/recon_test/test_MLEstimateComponentBasedNormalisation.cxx b/src/recon_test/test_MLEstimateComponentBasedNormalisation.cxx index e0561d488..34a1ce7b5 100644 --- a/src/recon_test/test_MLEstimateComponentBasedNormalisation.cxx +++ b/src/recon_test/test_MLEstimateComponentBasedNormalisation.cxx @@ -76,6 +76,13 @@ class MLEstimateComponentBasedNormalisationTest : public RunTests do_save_to_file); ml_estimator.process(); + // Check the efficiencies, with measured data as uniform 1s and model data as uniform 2s, expect this to be ~0.707 + auto efficiencies = ml_estimator.get_efficiencies(); + check_if_less(efficiencies.find_max(), 0.75, "The max value of the efficiencies is greater than expected"); + check_if_less(0.65, efficiencies.find_max(), "The max value of the efficiencies is less than expected"); + check_if_less(efficiencies.find_min(), 0.75, "The min value of the efficiencies is greater than expected"); + check_if_less(0.65, efficiencies.find_min(), "The min value of the efficiencies is less than expected"); + auto bin_normalization = ml_estimator.construct_bin_normfactors_from_components(); bin_normalization.set_up(measured_projdata->get_exam_info_sptr(), measured_projdata->get_proj_data_info_sptr());