STIR  6.2.0
ProjDataInfoGenericNoArcCorr.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2000- 2011-06-24, Hammersmith Imanet Ltd
3  Copyright (C) 2011-07-01 - 2011, Kris Thielemans
4  Copyright (C) 2017, ETH Zurich, Institute of Particle Physics and Astrophysics
5  This file is part of STIR.
6 
7  SPDX-License-Identifier: Apache-2.0
8 
9  See STIR/LICENSE.txt for details
10 */
11 
22 #ifndef __stir_ProjDataInfoGenericNoArcCorr_H__
23 #define __stir_ProjDataInfoGenericNoArcCorr_H__
24 
28 #include "stir/VectorWithOffset.h"
30 
31 START_NAMESPACE_STIR
32 
33 class Succeeded;
71 {
72 private:
74 #ifdef SWIG
75  // SWIG needs this typedef to be public
76  public:
77 #endif
79 
80 public:
83 
85  ProjDataInfoGenericNoArcCorr(const shared_ptr<Scanner> scanner_ptr,
86  const VectorWithOffset<int>& num_axial_pos_per_segment,
87  const VectorWithOffset<int>& min_ring_diff_v,
88  const VectorWithOffset<int>& max_ring_diff_v,
89  const int num_views,
90  const int num_tangential_poss);
91 
92  ProjDataInfo* clone() const override;
93 
94  bool operator==(const self_type&) const;
95 
97 
101  inline float get_s(const Bin&) const override;
102 
103  std::string parameter_info() const override;
104 
106 
107 
130  inline bool
131  get_view_tangential_pos_num_for_det_num_pair(int& view_num, int& tang_pos_num, const int det1_num, const int det2_num) const;
133 
146  inline void
147  get_det_num_pair_for_view_tangential_pos_num(int& det1_num, int& det2_num, const int view_num, const int tang_pos_num) const;
148 
150 
159  inline Succeeded get_bin_for_det_pos_pair(Bin&, const DetectionPositionPair<>&) const;
160 
162 
169  inline void get_det_pos_pair_for_bin(DetectionPositionPair<>&, const Bin&) const;
170 
172  unsigned int get_num_det_pos_pairs_for_bin(const Bin&) const;
173 
175 
183  void get_all_det_pos_pairs_for_bin(std::vector<DetectionPositionPair<>>&, const Bin&) const;
184 
185 private:
186  // old function, now private. Use get_bin_for_det_pos_pair instead.
188 
193  inline Succeeded
194  get_bin_for_det_pair(Bin&, const int det1_num, const int ring1_num, const int det2_num, const int ring2_num) const;
195 
196 public:
198 
204  inline void get_det_pair_for_bin(int& det1_num, int& ring1_num, int& det2_num, int& ring2_num, const Bin&) const;
205 
207 
208  Bin get_bin(const LOR<float>&, const double delta_time = 0.0) const override;
209 
211 
212 
218  void find_cartesian_coordinates_of_detection(CartesianCoordinate3D<float>& coord_1,
220  const Bin& bin) const override;
221 
222  virtual void find_cartesian_coordinates_given_scanner_coordinates(CartesianCoordinate3D<float>& coord_1,
224  const int Ring_A,
225  const int Ring_B,
226  const int det1,
227  const int det2) const;
228 
229 private:
230  // used in get_view_tangential_pos_num_for_det_num_pair()
231  struct Det1Det2
232  {
233  int det1_num;
234  int det2_num;
235  };
236  mutable VectorWithOffset<VectorWithOffset<Det1Det2>> uncompressed_view_tangpos_to_det1det2;
237  mutable bool uncompressed_view_tangpos_to_det1det2_initialised;
239  void initialise_uncompressed_view_tangpos_to_det1det2() const;
240 
241  // used in get_view_tangential_pos_num_for_det_num_pair()
242  // we prestore a lookup-table in terms for unmashed view/tangpos
243  struct ViewTangPosSwap
244  {
245  int view_num;
246  int tang_pos_num;
247  bool swap_detectors;
248  };
249  mutable VectorWithOffset<VectorWithOffset<ViewTangPosSwap>> det1det2_to_uncompressed_view_tangpos;
250  mutable bool det1det2_to_uncompressed_view_tangpos_initialised;
252  void initialise_det1det2_to_uncompressed_view_tangpos() const;
253 
255  inline void initialise_uncompressed_view_tangpos_to_det1det2_if_not_done_yet() const;
257  inline void initialise_det1det2_to_uncompressed_view_tangpos_if_not_done_yet() const;
258 
259 protected:
260  bool blindly_equals(const root_type* const) const override;
261 };
262 
263 END_NAMESPACE_STIR
264 
266 
267 #endif
Declaration of class stir::ProjDataInfoGeneric.
Implementation of inline functions of class stir::ProjDataInfoGenericNoArcCorr.
Projection data info for data for a scanner with discrete detectors.
Definition: ProjDataInfoGenericNoArcCorr.h:70
projection data info for data corresponding to &#39;Generic&#39; sampling.
Definition: ProjDataInfoGeneric.h:50
A class for storing coordinates and value of a single projection bin.
Definition: Bin.h:48
defines the stir::VectorWithOffset class
Declaration of class stir::GeometryBlocksOnCylindrical.
projection data info for data corresponding to a &#39;cylindrical&#39; sampling.
Definition: ProjDataInfoCylindrical.h:48
An (abstract base) class that contains information on the projection data.
Definition: ProjDataInfo.h:69
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
defines the stir::CartesianCoordinate3D<coordT> class
A class for storing 2 coordinates-sets of a detection, together with a timing-position index (for TOF...
Definition: DetectionPositionPair.h:40
Declaration of class stir::DetectionPositionPair.