STIR  6.3.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 "stir/ArrayFwd.h"
32 #include <complex>
33 
34 START_NAMESPACE_STIR
35 template <typename elemT>
36 class SegmentByView;
37 template <typename elemT>
38 class SegmentBySinogram;
39 // template <typename elemT> class Sinogram;
40 class Succeeded;
41 
42 /*
43  \class PETCount_rebinned
44  \brief Class for rebinned elements counter
45  \ingroup recon_buildblock
46 */
47 class PETCount_rebinned
48 {
49 
50 public:
52  int total;
54  int miss;
56  int ssrb;
57 
58 #ifdef PARALLEL
59  friend PMessage& operator<<(PMessage&, PETCount_rebinned&);
60  friend PMessage& operator>>(PMessage&, PETCount_rebinned&);
61 
62  PETCount_rebinned& operator+=(const PETCount_rebinned& rebin)
63  {
64  total += rebin.total;
65  miss += rebin.miss;
66  ssrb += rebin.ssrb;
67  return *this;
68  }
69 #endif
70  // Default constructor by initialising all the elements conter to null
71  explicit PETCount_rebinned(int total_v = 0, int miss_v = 0, int ssrb_v = 0)
72  : total(total_v),
73  miss(miss_v),
74  ssrb(ssrb_v){}
75 
76  ;
77 };
78 
113 class FourierRebinning : public RegisteredParsingObject<FourierRebinning, ProjDataRebinning, ProjDataRebinning>
114 {
115 private:
117 
118 public:
120  static const char* const registered_name;
121  void set_defaults() override;
122 
123 protected:
125  int kmin;
127  int wmin;
129  int deltamin;
131  int kc;
134 
135 public:
138 
140  std::string method_info() const override { return ("FORE"); }
141 
143  Succeeded rebin() override;
144 
146  inline void set_kmin(int km) { kmin = km; }
147  inline void set_wmin(int wm) { wmin = wm; }
148  inline void set_deltamin(int dm) { deltamin = dm; }
149  inline void set_kc(int kcc) { kc = kcc; }
150  inline void set_fore_debug_level(int fdebug) { fore_debug_level = fdebug; }
151 
152  inline int get_kmin() { return kmin; }
153  inline int get_wmin() { return wmin; }
154  inline int get_deltamin() { return deltamin; }
155  inline int get_kc() { return kc; }
156  inline int get_fore_debug_level() { return fore_debug_level; }
157 
158 private:
169  void rebinning(ArrayType<3, std::complex<float>>& FT_rebinned_data,
170  ArrayType<3, float>& Weights_for_FT_rebinned_data,
171  PETCount_rebinned& num_rebinned,
172  const ArrayType<2, std::complex<float>>& FT_current_sinogram,
173  const float z,
174  const float average_ring_difference_in_segment,
175  const int num_views_pow2,
176  const int num_tang_poss_pow2,
177  const float half_distance_between_rings,
178  const float sampling_distance_in_s,
179  const float radial_sampling_freq_w,
180  const float R_field_of_view_mm,
181  const float ratio_ring_spacing_to_ring_radius);
182 
195  void do_rebinning(ArrayType<3, std::complex<float>>& FT_rebinned_data,
196  ArrayType<3, float>& Weights_for_FT_rebinned_data,
197  PETCount_rebinned& count_rebinned,
198  const SegmentBySinogram<float>& segment,
199  const int num_tang_poss_pow2,
200  const int num_views_pow2,
201  const int num_planes,
202  const float average_ring_difference_in_segment,
203  const float half_distance_between_rings,
204  const float sampling_distance_in_s,
205  const float radial_sampling_freq_w,
206  const float R_field_of_view_mm,
207  const float ratio_ring_spacing_to_ring_radius);
208 
216  void do_log_file();
217 
219  void do_display_count(PETCount_rebinned& num_rebinned_total);
220 
222  void do_adjust_nb_views_to_pow2(SegmentBySinogram<float>& segment);
223 
225  Succeeded fore_check_parameters(int num_tang_poss_pow2, int num_views_pow2, int max_segment_num_to_process);
226 
227 protected:
228  bool post_processing() override;
229  void initialise_keymap() override;
230 };
231 
232 END_NAMESPACE_STIR
233 #endif
forward declaration of stir::Array class for multi-dimensional (numeric) arrays
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:146
int kc
kc index for consistency
Definition: FourierRebinning.h:131
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:120
int kmin
Smallest angular freq. index minimum 2 ( 1 is zero frequency)
Definition: FourierRebinning.h:125
int wmin
Smallest transax. freq. index minimum 2 ( 1 is zero frequency)
Definition: FourierRebinning.h:127
std::string method_info() const override
This method returns the type of the algorithm for the rebinning.
Definition: FourierRebinning.h:140
int fore_debug_level
fore_debug_level. Setting it to >0 will produce some debug information
Definition: FourierRebinning.h:133
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:113
This class defines multi-dimensional (numeric) arrays.
Definition: Array.h:77
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:129
Declaration of class stir::RegisteredParsingObject.