From 5237ef116c3837669576370979e1815f07f0559b Mon Sep 17 00:00:00 2001 From: Robert Twyman Date: Thu, 15 Oct 2020 11:21:27 +0100 Subject: [PATCH] Add method stir.ToPriorWithParabolicSurrogate() to python. Input is a GeneralisedPrior. This will give access to methods such as `parabolic_surrogate_curvature` and `add_multiplication_with_approximate_Hessian` from the objective function object. --- src/swig/stir.i | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/swig/stir.i b/src/swig/stir.i index db400915d7..2aa8cba073 100644 --- a/src/swig/stir.i +++ b/src/swig/stir.i @@ -1656,6 +1656,13 @@ stir::RegisteredParsingObject< stir::LogcoshPrior, stir::PriorWithParabolicSurrogate >; %template (LogcoshPrior3DFloat) stir::LogcoshPrior; +// Allows for access to parabolic surrogate type prior methods ( THIS IS A TEMPORARY FIX ) +%inline %{template stir::PriorWithParabolicSurrogate * ToPriorWithParabolicSurrogate(stir::GeneralisedPrior *b) { + return dynamic_cast*>(b); +} +%} +%template(ToPriorWithParabolicSurrogate) ToPriorWithParabolicSurrogate; + %template (Reconstruction3DFloat) stir::Reconstruction; //%template () stir::Reconstruction; %template (IterativeReconstruction3DFloat) stir::IterativeReconstruction;