From 52cf5e3109a08e3130715cd4c223fb55ee3c50c4 Mon Sep 17 00:00:00 2001 From: Evgueni Ovtchinnikov Date: Mon, 24 Jun 2024 12:29:58 +0000 Subject: [PATCH] tackled #1270 --- src/xSTIR/cSTIR/cstir_p.cpp | 13 ++++++++----- src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h | 10 ++++++++++ src/xSTIR/pSTIR/STIR.py | 8 ++++++++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/xSTIR/cSTIR/cstir_p.cpp b/src/xSTIR/cSTIR/cstir_p.cpp index bb145db55..0ff11f9b3 100644 --- a/src/xSTIR/cSTIR/cstir_p.cpp +++ b/src/xSTIR/cSTIR/cstir_p.cpp @@ -856,25 +856,28 @@ sirf::cSTIR_setScatterEstimatorParameter int value = dataFromHandle(hv); obj.set_num_iterations(value); } - else if (sirf::iequals(name, "set_OSEM_num_subiterations")) { int value = dataFromHandle(hv); obj.set_OSEM_num_subiterations(value); } - else if (sirf::iequals(name, "set_OSEM_num_subsets")) { int value = dataFromHandle(hv); obj.set_OSEM_num_subsets(value); } - - - else if (sirf::iequals(name, "set_output_prefix")) { obj.set_output_prefix(charDataFromHandle(hv)); } + else if (sirf::iequals(name, "set_max_scale_value")) + { + obj.set_max_scale_factor_value(dataFromHandle(hv)); + } + else if (sirf::iequals(name, "set_min_scale_value")) + { + obj.set_min_scale_factor_value(dataFromHandle(hv)); + } else return parameterNotFound(name, __FILE__, __LINE__); diff --git a/src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h b/src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h index 227d1d5e2..98c83d8bd 100644 --- a/src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h +++ b/src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h @@ -947,6 +947,16 @@ The actual algorithm is described in return this->get_reconstruction_method().get_num_subsets(); } + void set_max_scale_factor_value(float v) + { + set_max_scale_value(v); + } + + void set_min_scale_factor_value(float v) + { + set_min_scale_value(v); + } + std::shared_ptr get_scatter_estimate(int est_num = -1) const { if (est_num == -1) // Get the last one diff --git a/src/xSTIR/pSTIR/STIR.py b/src/xSTIR/pSTIR/STIR.py index 89e8ef8c5..5fddaa42d 100644 --- a/src/xSTIR/pSTIR/STIR.py +++ b/src/xSTIR/pSTIR/STIR.py @@ -3614,6 +3614,14 @@ def set_num_iterations(self, v): """Set number of iterations of the SSS algorithm to use.""" parms.set_int_par(self.handle, 'PETScatterEstimator', 'set_num_iterations', v) + def set_max_scale_value(self, v): + """Set maximal scale factor value of the SSS algorithm to use.""" + parms.set_float_par(self.handle, 'PETScatterEstimator', 'set_max_scale_value', v) + + def set_min_scale_value(self, v): + """Set maximal scale factor value of the SSS algorithm to use.""" + parms.set_float_par(self.handle, 'PETScatterEstimator', 'set_min_scale_value', v) + def set_output_prefix(self, v): """ Set prefix for filenames with scatter estimates.