From 51911cc3695f8c9826972e6656fd13b01b5cfaec Mon Sep 17 00:00:00 2001 From: Kris Thielemans Date: Wed, 10 Jul 2024 20:29:16 +0100 Subject: [PATCH] first steps to expose mask functions for Scatter --- src/xSTIR/cSTIR/cstir_p.cpp | 17 +++++++++++++++++ src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h | 8 ++++++++ 2 files changed, 25 insertions(+) diff --git a/src/xSTIR/cSTIR/cstir_p.cpp b/src/xSTIR/cSTIR/cstir_p.cpp index 7f3d29781..6233e971b 100644 --- a/src/xSTIR/cSTIR/cstir_p.cpp +++ b/src/xSTIR/cSTIR/cstir_p.cpp @@ -843,6 +843,23 @@ sirf::cSTIR_setScatterEstimatorParameter SPTR_FROM_HANDLE(STIRImageData, sptr_id, hv); obj.set_attenuation_image_sptr(sptr_id); } + else if (sirf::iequals(name, "setMaskImage")) + { + SPTR_FROM_HANDLE(STIRImageData, sptr_id, hv); + obj.set_mask_image_sptr(sptr_id); + } + else if (sirf::iequals(name, "setMaskAcqData")) + { + SPTR_FROM_HANDLE(STIRAcquisitionData, sptr_pd, hv); + obj.set_mask_acq_data_sptr(sptr_pd); + } +#if STIR_VERSION >= 060200 + else if (sirf::iequals(name, "setRecomputeMaskImage")) + { + bool value = dataFromHandle(hv); + obj.set_recompute_mask_image(value); + } +#endif else if (sirf::iequals(name, "setAttenuationCorrectionFactors")) { SPTR_FROM_HANDLE(STIRAcquisitionData, sptr_ad, hv); diff --git a/src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h b/src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h index 649c5fd51..629663934 100644 --- a/src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h +++ b/src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h @@ -902,6 +902,14 @@ The actual algorithm is described in stir::ScatterEstimation::set_attenuation_image_sptr(arg->data_sptr()); #endif } + void set_mask_image_sptr(std::shared_ptr arg) + { + stir::ScatterEstimation::set_mask_image_sptr(arg->data_sptr()); + } + void set_mask_acq_data_sptr(std::shared_ptr arg) + { + stir::ScatterEstimation::set_mask_proj_data_sptr(arg->data()); + } //! Set prefix for filenames with scatter estimates. /*!