STIR  6.2.0
PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2006- 2013, Hammersmith Imanet Ltd
5  Copyright (C) 2018, University College London
6 
7  SPDX-License-Identifier: Apache-2.0
8 
9  See STIR/LICENSE.txt for details
10 */
23 #ifndef __stir_recon_buildblock_PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData_H__
24 #define __stir_recon_buildblock_PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData_H__
28 #include "stir/VectorWithOffset.h"
29 #include "stir/DynamicProjData.h"
35 
36 START_NAMESPACE_STIR
37 
48 template <typename TargetT>
50  : public RegisteredParsingObject<PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData<TargetT>,
51  GeneralisedObjectiveFunction<TargetT>,
52  PoissonLogLikelihoodWithLinearModelForMean<TargetT>>
53 {
54 private:
58  base_type;
60  VectorWithOffset<SingleFrameObjFunc> _single_frame_obj_funcs;
61 
62 public:
64  static const char* const registered_name;
65 
67 
69 
72  TargetT* construct_target_ptr() const override;
73 
74  std::unique_ptr<ExamInfo> get_exam_info_uptr_for_target() const override;
75 
76 protected:
77  double actual_compute_objective_function_without_penalty(const TargetT& current_estimate, const int subset_num) override;
78 
79  Succeeded set_up_before_sensitivity(shared_ptr<const TargetT> const& target_sptr) override;
80 
82 
84  void add_subset_sensitivity(TargetT& sensitivity, const int subset_num) const override;
85 
86  Succeeded actual_add_multiplication_with_approximate_sub_Hessian_without_penalty(TargetT& output,
87  const TargetT& input,
88  const int subset_num) const override;
89 
90  Succeeded actual_accumulate_sub_Hessian_times_input_without_penalty(TargetT& output,
91  const TargetT& current_image_estimate,
92  const TargetT& input,
93  const int subset_num) const override;
94 
95 public:
101  const DynamicProjData& get_dyn_proj_data() const;
102  const shared_ptr<DynamicProjData>& get_dyn_proj_data_sptr() const;
103  const int get_max_segment_num_to_process() const;
104  const bool get_zero_seg0_end_planes() const;
105  const DynamicProjData& get_additive_dyn_proj_data() const;
106  const shared_ptr<DynamicProjData>& get_additive_dyn_proj_data_sptr() const;
107  const ProjectorByBinPair& get_projector_pair() const;
108  const shared_ptr<ProjectorByBinPair>& get_projector_pair_sptr() const;
109  const BinNormalisation& get_normalisation() const;
110  const shared_ptr<BinNormalisation>& get_normalisation_sptr() const;
112 
120  void set_recompute_sensitivity(const bool);
121  void set_sensitivity_sptr(const shared_ptr<TargetT>&);
122  int set_num_subsets(const int num_subsets) override;
123 
124  void set_normalisation_sptr(const shared_ptr<BinNormalisation>&) override;
125  void set_additive_proj_data_sptr(const shared_ptr<ExamData>&) override;
126 
127  void set_input_data(const shared_ptr<ExamData>&) override;
128  const DynamicProjData& get_input_data() const override;
130 protected:
132  std::string _input_filename;
133 
135  shared_ptr<DynamicProjData> _dyn_proj_data_sptr;
136 
138 
140 
141  /**********************/
142  ParseAndCreateFrom<TargetT, DynamicProjData> target_parameter_parser;
143 
144  /********************************/
148 
149  shared_ptr<DynamicProjData> _additive_dyn_proj_data_sptr;
151  shared_ptr<BinNormalisation> _normalisation_sptr;
153  shared_ptr<ProjectorByBinPair> _projector_pair_ptr;
156  // Patlak Plot Parameters
158  shared_ptr<PatlakPlot> _patlak_plot_sptr;
161 
162  bool actual_subsets_are_approximately_balanced(std::string& warning_message) const override;
163 
164  void actual_compute_subset_gradient_without_penalty(TargetT& gradient,
165  const TargetT& current_estimate,
166  const int subset_num,
167  const bool add_sensitivity) override;
168 
170 
173  void set_defaults() override;
174  void initialise_keymap() override;
175  bool post_processing() override;
176 };
177 
178 END_NAMESPACE_STIR
179 
180 //#include "stir/recon_buildblock/PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData.inl"
181 
182 #endif
shared_ptr< PatlakPlot > _patlak_plot_sptr
Definition: PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData.h:158
A templated class for vectors, but with indices starting not from 0.
Definition: ArrayFilter1DUsingConvolution.h:31
a base class for LogLikelihood of independent Poisson variables where the mean values are linear comb...
Definition: PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData.h:49
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
std::string _input_filename
Filename with input projection data.
Definition: PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData.h:132
DynamicDiscretisedDensity _dyn_image_template
dynamic image template
Definition: PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData.h:160
shared_ptr< BinNormalisation > _normalisation_sptr
Definition: PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData.h:151
Abstract base class for all projector pairs.
Definition: ProjectorByBinPair.h:44
int _max_segment_num_to_process
the maximum absolute ring difference number to use in the reconstruction
Definition: PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData.h:139
template for adding keywords to a parser and creating an object
Definition: ParseAndCreateFrom.h:52
Declaration of class stir::DynamicDiscretisedDensity.
Class of multiple image frames, one for each time frame Each time frame is a DiscretisedDensity<3,float>
Definition: DynamicDiscretisedDensity.h:45
Dynamic projection data.
Definition: DynamicProjData.h:36
shared_ptr< DynamicProjData > _additive_dyn_proj_data_sptr
points to the additive projection data
Definition: PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData.h:149
Abstract base class for implementing bin-wise normalisation of data.
Definition: BinNormalisation.h:51
Declaration of class stir::PoissonLogLikelihoodWithLinearModelForMean.
defines the stir::VectorWithOffset class
Declaration of class stir::ParametricDiscretisedDensity.
bool _zero_seg0_end_planes
signals whether to zero the data in the end planes of the projection data
Definition: PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData.h:155
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files...
Definition: RegisteredParsingObject.h:77
std::string _additive_dyn_proj_data_filename
name of file in which additive projection data are stored
Definition: PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData.h:146
static const char *const registered_name
Name which will be used when parsing a GeneralisedObjectiveFunction object.
Definition: PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData.h:64
Declaration of class stir::DynamicProjData.
shared_ptr< DynamicProjData > _dyn_proj_data_sptr
points to the object for the total input projection data
Definition: PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData.h:135
a base class for LogLikelihood of independent Poisson variables where the mean values are linear comb...
Definition: KOSMAPOSLReconstruction.h:39
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
Declaration of class stir::KineticParameters.
Declaration of class stir::RegisteredParsingObject.
Implementation of functions of class stir::PatlakPlot.
An objective function class appropriate for PET emission data.
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndProjData.h:121
shared_ptr< ProjectorByBinPair > _projector_pair_ptr
Stores the projectors that are used for the computations.
Definition: PoissonLogLikelihoodWithLinearKineticModelAndDynamicProjectionData.h:153
Definition of the stir::ParseAndCreateFrom class for stir::ParametricDiscretisedDensity.