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

Generate SWIG prior factory #709

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
15 changes: 15 additions & 0 deletions src/swig/stir.i
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@
#endif

%include "attribute.i"
%include "factory.i"

%init %{
#if defined(SWIGPYTHON)
Expand Down Expand Up @@ -1575,6 +1576,20 @@ namespace stir {
%shared_ptr(stir::FBP2DReconstruction);
%shared_ptr(stir::FBP3DRPReconstruction);

/* This currently fails, so is still commented out
%newobject *::get_objective_function;
%factory(
stir::GeneralisedObjectiveFunction<TargetT >& stir::IterativeReconstruction<TargetT >::get_objective_function,
%arg(stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData<TargetT >));
*/

// tell SWIG to convert the return of get_prior_ptr etc to the appropriate object
%newobject *::get_prior_ptr;
%factory(stir::GeneralisedPrior<TargetT> *stir::GeneralisedObjectiveFunction< TargetT >::get_prior_ptr,
stir::QuadraticPrior<elemT>,
stir::PLSPrior<elemT>,
stir::RelativeDifferencePrior<elemT>);

#undef TargetT
#undef elemT
#endif
Expand Down