Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STIR min/max-scale-factor in ScatterEstimation exposed. #1271

Merged
merged 5 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* SIRF/STIR (PET and SPECT)
- use direct STIR operations for arrays, potentially resulting in speed-up when using STIR 6.2 or later.
- added means for setting maximal and minimal value for scale factor in stir::ScatterEstimation

* CMake/building:
- set CMP0074 policy to NEW, i.e. honour <packagename>_ROOT env variables
Expand Down
13 changes: 8 additions & 5 deletions src/xSTIR/cSTIR/cstir_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,25 +856,28 @@ sirf::cSTIR_setScatterEstimatorParameter
int value = dataFromHandle<int>(hv);
obj.set_num_iterations(value);
}

else if (sirf::iequals(name, "set_OSEM_num_subiterations"))
{
int value = dataFromHandle<int>(hv);
obj.set_OSEM_num_subiterations(value);
}

else if (sirf::iequals(name, "set_OSEM_num_subsets"))
{
int value = dataFromHandle<int>(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_value(dataFromHandle<float>(hv));
}
else if (sirf::iequals(name, "set_min_scale_value"))
{
obj.set_min_scale_value(dataFromHandle<float>(hv));
}
else
return parameterNotFound(name, __FILE__, __LINE__);

Expand Down
12 changes: 12 additions & 0 deletions src/xSTIR/cSTIR/include/sirf/STIR/stir_x.h
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,18 @@ The actual algorithm is described in
return this->get_reconstruction_method().get_num_subsets();
}

//! Set maximal scale factor value of the SSS algorithm to use
void set_max_scale_value(float v)
KrisThielemans marked this conversation as resolved.
Show resolved Hide resolved
{
stir::ScatterEstimation::set_max_scale_value(v);
}

//! Set minimal scale factor value of the SSS algorithm to use
void set_min_scale_value(float v)
KrisThielemans marked this conversation as resolved.
Show resolved Hide resolved
{
stir::ScatterEstimation::set_min_scale_value(v);
}

std::shared_ptr<STIRAcquisitionData> get_scatter_estimate(int est_num = -1) const
{
if (est_num == -1) // Get the last one
Expand Down
8 changes: 8 additions & 0 deletions src/xSTIR/pSTIR/STIR.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading