STIR  6.2.0
PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2005- 2011, 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 */
20 #ifndef __stir_recon_buildblock_PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion_H__
21 #define __stir_recon_buildblock_PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion_H__
22 
25 #include "stir/GatedProjData.h"
27 #include "stir/DataProcessor.h"
31 
32 START_NAMESPACE_STIR
33 class GatedProjData;
34 
39 template <typename TargetT>
40 class PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion
41  : public RegisteredParsingObject<
42  PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion<TargetT>,
43  GeneralisedObjectiveFunction<TargetT>,
44  SumOfGeneralisedObjectiveFunctions<PoissonLogLikelihoodWithLinearModelForMeanAndProjData<TargetT>,
45  TargetT,
46  PoissonLogLikelihoodWithLinearModelForMean<TargetT>>>
47 {
48 private:
49  typedef RegisteredParsingObject<
50  PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion<TargetT>,
51  GeneralisedObjectiveFunction<TargetT>,
52  SumOfGeneralisedObjectiveFunctions<PoissonLogLikelihoodWithLinearModelForMeanAndProjData<TargetT>,
53  TargetT,
54  PoissonLogLikelihoodWithLinearModelForMean<TargetT>>>
55  base_type;
56 
57 public:
59  static const char* const registered_name;
60 
62  PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion();
63 
72  void set_proj_data_sptr(const shared_ptr<GatedProjData>&);
73  void set_max_segment_num_to_process(const int);
74  void set_zero_seg0_end_planes(const bool);
75  void set_additive_proj_data_sptr(const shared_ptr<GatedProjData>&);
76  void set_projector_pair_sptr(const shared_ptr<ProjectorByBinPair>&);
77  void set_frame_num(const int);
78  void set_frame_definitions(const TimeFrameDefinitions&);
80 
81  virtual TargetT* construct_target_ptr() const;
82 
83  virtual void
84  compute_sub_gradient_without_penalty_plus_sensitivity(TargetT& gradient, const TargetT& target, const int subset_num);
85 
86 protected:
87  virtual Succeeded set_up_before_sensitivity(shared_ptr<TargetT> const& target_sptr);
88 
89  virtual void add_subset_sensitivity(TargetT& sensitivity, const int subset_num) const;
90 
92  std::string _input_filename;
93 
95 
97 
98  /**********************/
99  // image stuff
100  // TODO to be replaced with single class or so (TargetT obviously)
102 
104  int output_image_size_xy; // KT 10122001 appended _xy
105 
107 
109  int output_image_size_z; // KT 10122001 new
110 
112  double zoom;
113 
115  double Xoffset;
116 
118  double Yoffset;
119 
120  // KT 20/06/2001 new
122  double Zoffset;
123  /********************************/
124 
126  shared_ptr<ProjectorByBinPair> projector_pair_ptr;
127 
130 
133 
134  // TODO doc
135  int frame_num;
136  std::string frame_definition_filename;
137  TimeFrameDefinitions frame_defs;
138  VectorWithOffset<shared_ptr<BinNormalisation>> _normalisation_sptrs;
139 
140 private:
141  virtual void set_defaults();
142  virtual void initialise_keymap();
143  virtual bool post_processing();
144 
145  shared_ptr<GatedProjData> _gated_proj_data_sptr;
146  shared_ptr<GatedProjData> _gated_additive_proj_data_sptr;
147 
148  shared_ptr<DataSymmetriesForViewSegmentNumbers> symmetries_sptr;
149 
150  VectorWithOffset<shared_ptr<DataProcessor<TargetT>>> _forward_transformations;
151 };
152 
153 END_NAMESPACE_STIR
154 
155 //#include "stir/recon_buildblock/PoissonLogLikelihoodWithLinearModelForMean.inl"
156 
157 #endif
bool zero_seg0_end_planes
signals whether to zero the data in the end planes of the projection data
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion.h:129
Class used for storing time frame durations.
Definition: TimeFrameDefinitions.h:38
Declaration of class stir::TimeFrameDefinitions.
A templated class for vectors, but with indices starting not from 0.
Definition: ArrayFilter1DUsingConvolution.h:31
int output_image_size_xy
the output image size in x and y direction
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion.h:104
Declaration of class stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData. ...
int max_segment_num_to_process
the maximum absolute ring difference number to use in the reconstruction
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion.h:96
Declaration of class stir::DataProcessor.
Declaration of class stir::SumOfGeneralisedObjectiveFunctions.
Declaration of class stir::BinNormalisation.
std::string _additive_projection_data_filename
name of file in which loglikelihood measurements are stored
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion.h:132
int output_image_size_z
the output image size in z direction
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion.h:109
Declaration of class stir::GatedProjData.
double Xoffset
offset in the x-direction
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion.h:115
Declaration of class stir::RegisteredParsingObject.
double zoom
the zoom factor
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion.h:112
shared_ptr< ProjectorByBinPair > projector_pair_ptr
Stores the projectors that are used for the computations.
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion.h:126
double Zoffset
offset in the z-direction
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion.h:122
double Yoffset
offset in the y-direction
Definition: PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion.h:118
Declares class stir::ProjectorByBinPair.