STIR  6.2.0
SqrtHessianRowSum.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2020, University College London
3  This file is part of STIR.
4 
5  SPDX-License-Identifier: Apache-2.0
6 
7  See STIR/LICENSE.txt for details
8 */
9 
19 #ifndef STIR_SQRTHESSIANROWSUM_H
20 #define STIR_SQRTHESSIANROWSUM_H
21 
22 #include "stir/info.h"
24 #include "stir/IO/read_from_file.h"
25 #include "stir/is_null_ptr.h"
31 
32 START_NAMESPACE_STIR
33 
34 class Succeeded;
35 
57 template <typename TargetT>
59 {
60 public:
62 
64  explicit SqrtHessianRowSum(const std::string&);
65 
67 
69  void set_defaults() override;
70 
72 
74  void process_data();
75 
77 
78  GeneralisedObjectiveFunction<TargetT> const& get_objective_function_sptr();
79  void set_objective_function_sptr(const shared_ptr<GeneralisedObjectiveFunction<TargetT>>& obj_fun);
81 
83 
84  shared_ptr<TargetT> get_input_image_sptr();
85  void set_input_image_sptr(shared_ptr<TargetT> const& image);
87 
89  shared_ptr<TargetT> get_output_target_sptr();
90 
91  void set_up();
92 
94 
95  bool get_use_approximate_hessian() const;
96  void set_use_approximate_hessian(bool use_approximate);
98 
100 
101  bool get_compute_with_penalty() const;
102  void set_compute_with_penalty(bool with_penalty);
104 
107  void compute_Hessian_row_sum();
108 
111  void compute_approximate_Hessian_row_sum();
112 
113 protected:
114  bool _already_setup = false;
115 
116 private:
118  shared_ptr<GeneralisedObjectiveFunction<TargetT>> objective_function_sptr;
119 
121  std::string output_filename;
122 
124  std::string input_image_filename;
125 
127  shared_ptr<TargetT> input_image_sptr;
128 
130  shared_ptr<TargetT> output_target_sptr;
131 
136  bool use_approximate_hessian;
137 
140  bool compute_with_penalty;
141 
143  shared_ptr<OutputFileFormat<TargetT>> output_file_format_sptr;
144 
146  int _verbosity;
147 
149  bool post_processing() override;
150  void initialise_keymap() override;
151 };
152 
153 END_NAMESPACE_STIR
154 #endif // STIR_SQRTHESSIANROWSUM_H
Declaration of class stir::PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion.
Declaration of class stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData. ...
A base class for &#39;generalised&#39; objective functions, i.e. objective functions for which at least a &#39;gr...
Definition: GeneralisedObjectiveFunction.h:83
A base class for objects that want to be able to parse parameter files.
Definition: ParsingObject.h:44
Implementations of two square root Hessian row sum computation methods, as proposed by Tsai et al...
Definition: SqrtHessianRowSum.h:58
Declaration of class stir::OutputFileFormat.
Definition of stir::is_null_ptr functions.
Declaration of class stir::PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData.
Declaration of class stir::GeneralisedObjectiveFunction.
Declaration of stir::info()
Declaration of class stir::GeneralisedPrior.
Declaration of stir::read_from_file functions (providing easy access to class stir::InputFileFormatRe...