STIR  6.2.0
PoissonLogLikelihoodWithLinearModelForMeanAndListModeData.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2003- 2007, Hammersmith Imanet Ltd
5  Copyright (C) 2018, 2022 University College London
6  Copyright (C) 2021, University of Pennsylvania
7  This file is part of STIR.
8 
9  SPDX-License-Identifier: Apache-2.0
10 
11  See STIR/LICENSE.txt for details
12 */
24 #ifndef __stir_recon_buildblock_PoissonLogLikelihoodWithLinearModelForMeanAndListModeData_H__
25 #define __stir_recon_buildblock_PoissonLogLikelihoodWithLinearModelForMeanAndListModeData_H__
26 
27 //#include "stir/RegisteredParsingObject.h"
32 
33 START_NAMESPACE_STIR
34 
63 template <typename TargetT>
65 {
66 private:
68 
69 public:
71 
72  // virtual TargetT * construct_target_ptr();
73 
74  Succeeded set_up_before_sensitivity(shared_ptr<const TargetT> const& target_sptr) override;
75 
77 
84 
85  void set_normalisation_sptr(const shared_ptr<BinNormalisation>&) override;
86  void set_additive_proj_data_sptr(const shared_ptr<ExamData>&) override;
87 
88  void set_input_data(const shared_ptr<ExamData>&) override;
89  const ListModeData& get_input_data() const override;
91 
95  void set_max_segment_num_to_process(int);
97 
98  int get_max_segment_num_to_process() const;
99 
112 
116  virtual void set_cache_path(const std::string& cache_path);
118  virtual std::string get_cache_path() const;
119 
121 
124  virtual std::string get_cache_filename(unsigned int icache) const;
125 
127 
128  void set_recompute_cache(bool);
129  bool get_recompute_cache() const;
130 
132 
138  void set_skip_lm_input_file(const bool arg);
139 
141 
146  virtual void set_cache_max_size(const unsigned long int arg);
147 
149  virtual unsigned long int get_cache_max_size() const;
150 
152 protected:
153  std::string frame_defs_filename;
154 
156  std::string list_mode_filename;
157 
158  shared_ptr<ProjData> additive_proj_data_sptr;
163 
164  shared_ptr<BinNormalisation> normalisation_sptr;
165 
167  shared_ptr<ListModeData> list_mode_data_sptr;
168 
169  unsigned int current_frame_num;
170 
175 
177 
178  void set_defaults() override;
180 
181  void initialise_keymap() override;
182 
183  bool post_processing() override;
184 
186 
187  virtual void start_new_time_frame(const unsigned int new_frame_num);
188 
189  ParseAndCreateFrom<TargetT, ListModeData> target_parameter_parser;
190 
194  unsigned long int cache_size;
205  std::string cache_path;
207  bool has_add;
209 
210  shared_ptr<ProjDataInfo> proj_data_info_sptr;
211 
212 private:
214 
215  int max_segment_num_to_process;
216 };
217 
218 END_NAMESPACE_STIR
219 
220 //#include "stir/recon_buildblock/PoissonLogLikelihoodWithLinearModelForMean.inl"
221 
222 #endif
Class used for storing time frame durations.
Definition: TimeFrameDefinitions.h:38
unsigned long int cache_size
This is the number of records to be cached. If this parameter is more than zero, then the flag cache_...
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndListModeData.h:194
Definition of the stir::ParseAndCreateFrom class.
Declaration of class stir::TimeFrameDefinitions.
shared_ptr< ProjDataInfo > proj_data_info_sptr
ProjDataInfo.
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndListModeData.h:210
bool reduce_memory_usage
If true, the additive sinogram will not be read in memory.
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndListModeData.h:162
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 cache_path
Path to read/write the cached listmode file.
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndListModeData.h:205
long int num_events_to_use
This is part of some functionality I transfer from LmToProjData.
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndListModeData.h:172
bool recompute_cache
On the first cached run, the cache will be written in the cache_path. If recompute_cache is set to ze...
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndListModeData.h:201
std::string list_mode_filename
Filename with input projection data.
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndListModeData.h:156
TimeFrameDefinitions frame_defs
time frame definitions
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndListModeData.h:83
An objective function class appropriate for PET list mode data.
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndListModeData.h:64
The base class for reading list mode data.
Definition: ListModeData.h:123
template for adding keywords to a parser and creating an object
Definition: ParseAndCreateFrom.h:52
bool do_time_frame
Reconstruct based on time frames.
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndListModeData.h:174
shared_ptr< ListModeData > list_mode_data_sptr
Listmode pointer.
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndListModeData.h:167
bool cache_lm_file
This flag is true when cache_size is more than zero.
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndListModeData.h:196
Declaration of class stir::PoissonLogLikelihoodWithLinearModelForMean.
bool skip_lm_input_file
This flag is set when we don&#39;t set an input lm filename and rely only on the cache file...
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndListModeData.h:203
std::string additive_projection_data_filename
filename for additive data (only used when parsing)
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndListModeData.h:160
Declaration of class stir::ListModeData.
bool has_add
The data set has additive corrections.
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndListModeData.h:207
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