STIR  6.2.0
FourierRebinning.h
Go to the documentation of this file.
1 //
2 //
3 
13 /*
14  Copyright (C) 2000 PARAPET partners
15  Copyright (C) 2003 - 2005, Hammersmith Imanet Ltd
16  Copyright (C) 2004 - 2005 DKFZ Heidelberg, Germany
17  Copyright (C) 2011-07-01 - 2012, Kris Thielemans
18 
19  This file is part of STIR.
20 
21  SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
22 
23  See STIR/LICENSE.txt for details
24 */
25 
26 #ifndef __stir_recon_buildblock_FourierRebinning_H__
27 #define __stir_recon_buildblock_FourierRebinning_H__
28 
31 #include <complex>
32 
33 START_NAMESPACE_STIR
34 template <typename elemT>
35 class SegmentByView;
36 template <typename elemT>
37 class SegmentBySinogram;
38 // template <typename elemT> class Sinogram;
39 template <int num_dimensions, typename elemT>
40 class Array;
41 class Succeeded;
42 
43 /*
44  \class PETCount_rebinned
45  \brief Class for rebinned elements counter
46  \ingroup recon_buildblock
47 */
48 class PETCount_rebinned
49 {
50 
51 public:
53  int total;
55  int miss;
57  int ssrb;
58 
59 #ifdef PARALLEL
60  friend PMessage& operator<<(PMessage&, PETCount_rebinned&);
61  friend PMessage& operator>>(PMessage&, PETCount_rebinned&);
62 
63  PETCount_rebinned& operator+=(const PETCount_rebinned& rebin)
64  {
65  total += rebin.total;
66  miss += rebin.miss;
67  ssrb += rebin.ssrb;
68  return *this;
69  }
70 #endif
71  // Default constructor by initialising all the elements conter to null
72  explicit PETCount_rebinned(int total_v = 0, int miss_v = 0, int ssrb_v = 0)
73  : total(total_v),
74  miss(miss_v),
75  ssrb(ssrb_v){}
76 
77  ;
78 };
79 
114 class FourierRebinning : public RegisteredParsingObject<FourierRebinning, ProjDataRebinning, ProjDataRebinning>
115 {
116 private:
118 
119 public:
121  static const char* const registered_name;
122  void set_defaults() override;
123 
124 protected:
126  int kmin;
128  int wmin;
130  int deltamin;
132  int kc;
135 
136 public:
139 
141  std::string method_info() const override { return ("FORE"); }
142 
144  Succeeded rebin() override;
145 
147  inline void set_kmin(int km) { kmin = km; }
148  inline void set_wmin(int wm) { wmin = wm; }
149  inline void set_deltamin(int dm) { deltamin = dm; }
150  inline void set_kc(int kcc) { kc = kcc; }
151  inline void set_fore_debug_level(int fdebug) { fore_debug_level = fdebug; }
152 
153  inline int get_kmin() { return kmin; }
154  inline int get_wmin() { return wmin; }
155  inline int get_deltamin() { return deltamin; }
156  inline int get_kc() { return kc; }
157  inline int get_fore_debug_level() { return fore_debug_level; }
158 
159 private:
170  void rebinning(Array<3, std::complex<float>>& FT_rebinned_data,
171  Array<3, float>& Weights_for_FT_rebinned_data,
172  PETCount_rebinned& num_rebinned,
173  const Array<2, std::complex<float>>& FT_current_sinogram,
174  const float z,
175  const float average_ring_difference_in_segment,
176  const int num_views_pow2,
177  const int num_tang_poss_pow2,
178  const float half_distance_between_rings,
179  const float sampling_distance_in_s,
180  const float radial_sampling_freq_w,
181  const float R_field_of_view_mm,
182  const float ratio_ring_spacing_to_ring_radius);
183 
196  void do_rebinning(Array<3, std::complex<float>>& FT_rebinned_data,
197  Array<3, float>& Weights_for_FT_rebinned_data,
198  PETCount_rebinned& count_rebinned,
199  const SegmentBySinogram<float>& segment,
200  const int num_tang_poss_pow2,
201  const int num_views_pow2,
202  const int num_planes,
203  const float average_ring_difference_in_segment,
204  const float half_distance_between_rings,
205  const float sampling_distance_in_s,
206  const float radial_sampling_freq_w,
207  const float R_field_of_view_mm,
208  const float ratio_ring_spacing_to_ring_radius);
209 
217  void do_log_file();
218 
220  void do_display_count(PETCount_rebinned& num_rebinned_total);
221 
223  void do_adjust_nb_views_to_pow2(SegmentBySinogram<float>& segment);
224 
226  Succeeded fore_check_parameters(int num_tang_poss_pow2, int num_views_pow2, int max_segment_num_to_process);
227 
228 protected:
229  bool post_processing() override;
230  void initialise_keymap() override;
231 };
232 
233 END_NAMESPACE_STIR
234 #endif
A class for storing (3d) projection data with fixed SegmentIndices.
Definition: FBP3DRPReconstruction.h:41
void set_kmin(int km)
A set of get and set utility functions to access the rebinning parameters.
Definition: FourierRebinning.h:147
int kc
kc index for consistency
Definition: FourierRebinning.h:132
base class for all rebinning algorithms for 3D PET dataTODO describe what rebinning is and why you ne...
Definition: ProjDataRebinning.h:71
static const char *const registered_name
Name which will be used when parsing a ProjDataRebinning object.
Definition: FourierRebinning.h:121
int kmin
Smallest angular freq. index minimum 2 ( 1 is zero frequency)
Definition: FourierRebinning.h:126
int wmin
Smallest transax. freq. index minimum 2 ( 1 is zero frequency)
Definition: FourierRebinning.h:128
std::string method_info() const override
This method returns the type of the algorithm for the rebinning.
Definition: FourierRebinning.h:141
int fore_debug_level
fore_debug_level. Setting it to >0 will produce some debug information
Definition: FourierRebinning.h:134
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files...
Definition: RegisteredParsingObject.h:77
Class for Serial FORE Reconstruction.
Definition: FourierRebinning.h:114
This class defines multi-dimensional (numeric) arrays.
Definition: Array.h:73
declares the stir::ProjDataRebinning class
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
int deltamin
Delta max for small omega limiting delta for SSRB for small freq.
Definition: FourierRebinning.h:130
Declaration of class stir::RegisteredParsingObject.