24 #ifndef __stir_recon_buildblock_LogcoshPrior_H__ 25 #define __stir_recon_buildblock_LogcoshPrior_H__ 80 template <
typename elemT>
82 GeneralisedPrior<DiscretisedDensity<3, elemT>>,
83 PriorWithParabolicSurrogate<DiscretisedDensity<3, elemT>>>
99 LogcoshPrior(
const bool only_2D,
float penalization_factor);
102 LogcoshPrior(
const bool only_2D,
float penalization_factor,
const float scalar);
106 bool is_convex()
const override;
139 shared_ptr<DiscretisedDensity<3, elemT>> get_kappa_sptr()
const;
145 float get_scalar()
const;
148 void set_scalar(
float scalar_v);
174 void set_defaults()
override;
175 void initialise_keymap()
override;
176 bool post_processing()
override;
183 shared_ptr<DiscretisedDensity<3, elemT>> kappa_ptr;
191 static inline float logcosh(
const float d)
193 const float x = fabs(d);
200 return x + log(0.5f);
211 static inline float surrogate(
const float d,
const float scalar)
213 const float eps = 0.01;
214 const float x = d * scalar;
237 elemT derivative_20(
const elemT x_j,
const elemT x_k)
const;
238 elemT derivative_11(
const elemT x_j,
const elemT x_k)
const;
A class in the GeneralisedPrior hierarchy. This implements a logcosh Gibbs prior. ...
Definition: LogcoshPrior.h:81
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast (or corresponding b...
defines the stir::DiscretisedDensity class
defines the Array class for multi-dimensional (numeric) arrays
bool only_2D
can be set during parsing to restrict the weights to the 2D case
Definition: LogcoshPrior.h:152
A base class for 'generalised' priors, i.e. priors for which at least a 'gradient' is defined...
Definition: GeneralisedPrior.h:41
std::string gradient_filename_prefix
filename prefix for outputting the gradient whenever compute_gradient() is called.
Definition: LogcoshPrior.h:162
Array< 3, float > weights
penalty weights
Definition: LogcoshPrior.h:169
this class implements priors with a parabolic surrogate curvature
Definition: PriorWithParabolicSurrogate.h:39
bool parabolic_surrogate_curvature_depends_on_argument() const override
A function that allows skipping some computations if the curvature is independent of the current_esti...
Definition: LogcoshPrior.h:104
static const char *const registered_name
Name which will be used when parsing a GeneralisedPrior object.
Definition: LogcoshPrior.h:93
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files...
Definition: RegisteredParsingObject.h:77
NUMBER square(const NUMBER &x)
returns the square of a number, templated.
Definition: common.h:146
float scalar
controls the transition between the quadratic (smooth) and linear (edge-preserving) nature of the pri...
Definition: LogcoshPrior.h:155
Declaration of class stir::PriorWithParabolicSurrogate.
Declaration of class stir::RegisteredParsingObject.
std::string kappa_filename
Filename for the image that will be read by post_processing()
Definition: LogcoshPrior.h:172
This abstract class is the basis for all image representations.
Definition: FBP2DReconstruction.h:35