Skip to content

Commit

Permalink
tackled #1270
Browse files Browse the repository at this point in the history
  • Loading branch information
evgueni-ovtchinnikov committed Jun 24, 2024
1 parent 81f5c0a commit 52cf5e3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
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_factor_value(dataFromHandle<float>(hv));
}
else if (sirf::iequals(name, "set_min_scale_value"))
{
obj.set_min_scale_factor_value(dataFromHandle<float>(hv));
}
else
return parameterNotFound(name, __FILE__, __LINE__);

Expand Down
10 changes: 10 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,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<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

0 comments on commit 52cf5e3

Please sign in to comment.