STIR  6.2.0
GeneralisedPrior.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2000- 2007, Hammersmith Imanet Ltd
5  This file is part of STIR.
6 
7  SPDX-License-Identifier: Apache-2.0
8 
9  See STIR/LICENSE.txt for details
10 */
21 #ifndef __stir_recon_buildblock_GeneralisedPrior_H__
22 #define __stir_recon_buildblock_GeneralisedPrior_H__
23 
24 #include "stir/RegisteredObject.h"
25 #include "stir/ParsingObject.h"
26 
27 START_NAMESPACE_STIR
28 
29 class Succeeded;
30 
40 template <typename DataT>
41 class GeneralisedPrior : public RegisteredObject<GeneralisedPrior<DataT>>
42 
43 {
44 public:
45  inline GeneralisedPrior();
46 
48 
50  virtual double compute_value(const DataT& current_estimate) = 0;
51 
53 
56  virtual void compute_gradient(DataT& prior_gradient, const DataT& current_estimate) = 0;
57 
59 
66  virtual void compute_Hessian(DataT& prior_Hessian_for_single_densel,
67  const BasicCoordinate<3, int>& coords,
68  const DataT& current_image_estimate) const;
69 
71 
77  virtual void add_multiplication_with_approximate_Hessian(DataT& output, const DataT& input) const;
78 
80 
84  virtual void accumulate_Hessian_times_input(DataT& output, const DataT& current_estimate, const DataT& input) const;
85 
86  inline float get_penalisation_factor() const;
87  inline void set_penalisation_factor(float new_penalisation_factor);
88 
90  virtual Succeeded set_up(shared_ptr<const DataT> const& target_sptr);
91 
93 
94  virtual bool is_convex() const = 0;
95 
96 protected:
97  float penalisation_factor;
99 
100  void set_defaults() override;
102 
103  void initialise_keymap() override;
104 
106  virtual void check(DataT const& current_estimate) const;
107 
108  bool _already_set_up;
109 };
110 
111 END_NAMESPACE_STIR
112 
114 
115 #endif
Declaration of class stir::ParsingObject.
A base class for &#39;generalised&#39; priors, i.e. priors for which at least a &#39;gradient&#39; is defined...
Definition: GeneralisedPrior.h:41
Inline implementations for class stir::GeneralisedPrior.
Declaration of class stiir::RegisteredObject.
Helper class to provide registry mechanisms to a Base classSuppose you have a hierarchy of classes wi...
Definition: RegisteredObject.h:95
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43