diff --git a/CHANGES.md b/CHANGES.md index ee28ca907..f6699f444 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ * SIRF/STIR - prior value returned as double + - ScatterEstimation has extra methods that allow setting masks for the tail-fitting ## v3.8.0 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 742773015..ce5c11e7a 100644 --- a/src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h +++ b/src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h @@ -902,6 +902,20 @@ 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()); + } +#if STIR_VERSION >= 060200 + void set_recompute_mask_image(bool arg) + { + stir::ScatterEstimation::set_recompute_mask_image(arg); + } +#endif //! Set prefix for filenames with scatter estimates. /*! diff --git a/src/xSTIR/pSTIR/STIR.py b/src/xSTIR/pSTIR/STIR.py index 8e1e4fd5c..2584ff5f7 100644 --- a/src/xSTIR/pSTIR/STIR.py +++ b/src/xSTIR/pSTIR/STIR.py @@ -3608,6 +3608,15 @@ def set_attenuation_correction_factors(self, arg): assert_validity(arg, AcquisitionData) parms.set_parameter(self.handle, self.name, 'setAttenuationCorrectionFactors', arg.handle) + def set_mask_image(self, image): + assert_validity(image, ImageData) + parms.set_parameter(self.handle, self.name, 'setMaskImage', image.handle) + + def set_mask_acq_data(self, arg): + assert_validity(arg, AcquisitionData) + parms.set_parameter(self.handle, self.name, 'setMaskAcqData', arg.handle) + + def set_input(self, acq_data): assert_validity(acq_data, AcquisitionData) parms.set_parameter(self.handle, self.name, 'setInput', acq_data.handle)