STIR  6.2.0
DataSymmetriesForBins_PET_CartesianGrid.h
Go to the documentation of this file.
1 //
2 //
14 /*
15  Copyright (C) 2000 PARAPET partners
16  Copyright (C) 2000- 2011, Hammersmith Imanet Ltd
17  This file is part of STIR.
18 
19  SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
20 
21  See STIR/LICENSE.txt for details
22 */
23 #ifndef __stir_recon_buildblock_DataSymmetriesForBins_PET_CartesianGrid_H__
24 #define __stir_recon_buildblock_DataSymmetriesForBins_PET_CartesianGrid_H__
25 
27 //#include "stir/SymmetryOperations_PET_CartesianGrid.h"
28 //#include "stir/ViewSegmentNumbers.h"
29 //#include "stir/VoxelsOnCartesianGrid.h"
30 #include "stir/Bin.h"
31 #include "stir/shared_ptr.h"
32 
33 START_NAMESPACE_STIR
34 
35 template <int num_dimensions, typename elemT>
36 class DiscretisedDensity;
37 template <int num_dimensions, typename elemT>
38 class DiscretisedDensityOnCartesianGrid;
39 class ProjDataInfoCylindrical;
40 
50 {
51 private:
54 
55 public:
57 
84  DataSymmetriesForBins_PET_CartesianGrid(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr,
85  const shared_ptr<const DiscretisedDensity<3, float>>& image_info_ptr,
86  const bool do_symmetry_90degrees_min_phi = true,
87  const bool do_symmetry_180degrees_min_phi = true,
88  const bool do_symmetry_swap_segment = true,
89  const bool do_symmetry_swap_s = true,
90  const bool do_symmetry_shift_z = true);
91 
92 #ifndef STIR_NO_COVARIANT_RETURN_TYPES
94 #else
96 #endif
97  *
98  clone() const override;
99 
101  virtual bool operator==(const DataSymmetriesForBins_PET_CartesianGrid&) const;
102 
103 #if 0
104  TODO!
106  virtual BinIndexRange
107  get_basic_bin_index_range() const;
108 #endif
109 
110  inline void get_related_bins_factorised(std::vector<AxTangPosNumbers>&,
111  const Bin& b,
112  const int min_axial_pos_num,
113  const int max_axial_pos_num,
114  const int min_tangential_pos_num,
115  const int max_tangential_pos_num) const override;
116 
117  inline int num_related_bins(const Bin& b) const override;
118 
119  inline unique_ptr<SymmetryOperation> find_symmetry_operation_from_basic_bin(Bin&) const override;
120 
121  inline bool find_basic_bin(Bin& b) const override;
122 
123  inline int num_related_view_segment_numbers(const ViewSegmentNumbers& vs) const override;
124 
125  inline void get_related_view_segment_numbers(std::vector<ViewSegmentNumbers>& rel_vs,
126  const ViewSegmentNumbers& vs) const override;
127 
128  inline bool find_basic_view_segment_numbers(ViewSegmentNumbers& v_s) const override;
129 
131  inline float get_num_planes_per_scanner_ring() const;
132 
134 
139  inline float get_num_planes_per_axial_pos(const int segment_num) const;
140  inline float get_axial_pos_to_z_offset(const int segment_num) const;
141 
143 
144  inline bool using_symmetry_90degrees_min_phi() const
145  {
146  return do_symmetry_90degrees_min_phi;
147  }
148  inline bool using_symmetry_180degrees_min_phi() const
149  {
150  return do_symmetry_180degrees_min_phi;
151  }
152  inline bool using_symmetry_swap_segment() const
153  {
154  return do_symmetry_swap_segment;
155  }
156  inline bool using_symmetry_swap_s() const
157  {
158  return do_symmetry_swap_s;
159  }
160  inline bool using_symmetry_shift_z() const
161  {
162  return do_symmetry_shift_z;
163  }
165 
166 private:
167  bool do_symmetry_90degrees_min_phi;
168  bool do_symmetry_180degrees_min_phi;
169  bool do_symmetry_swap_segment;
170  bool do_symmetry_swap_s;
171  bool do_symmetry_shift_z;
172  // const shared_ptr<ProjDataInfo>& proj_data_info_ptr;
173  int num_views;
174  int num_planes_per_scanner_ring;
176  VectorWithOffset<int> num_planes_per_axial_pos;
178  VectorWithOffset<float> axial_pos_to_z_offset;
181 
182  void initialise_deltas(const ProjDataInfoCylindrical*);
183 
184 #if 0
185  // at the moment, we don't need the following 2 members
186 
187  // TODO somehow store only the info
188  shared_ptr<constDiscretisedDensity<3,float> > image_info_ptr;
189 
190  // a convenience function that does the dynamic_cast from the above
192  cartesian_grid_info_ptr() const;
193 #endif
194 
195  bool blindly_equals(const root_type* const) const override;
196 
197  inline bool
198  find_basic_bin(int& segment_num, int& view_num, int& axial_pos_num, int& tangential_pos_num, int& timing_pos_num) const;
199 
200  inline int find_transform_z(const int segment_num, const int axial_pos_num) const;
201 
202  inline SymmetryOperation* find_sym_op_general_bin(int s, int seg, int view_num, int axial_pos_num) const;
203 
204  inline SymmetryOperation* find_sym_op_bin0(int seg, int view_num, int axial_pos_num) const;
205 };
206 
207 END_NAMESPACE_STIR
208 
210 
211 #endif
Declaration of class stir::DataSymmetriesForBins.
A class for encoding/finding symmetries common to the geometry of the projection data and the discret...
Definition: DataSymmetriesForBins.h:67
Encodes symmetry operation on image coordinates and projection data coordinates.
Definition: SymmetryOperation.h:61
This abstract class is the basis for images on a Cartesian grid.
Definition: DiscretisedDensityOnCartesianGrid.h:44
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast (or corresponding b...
Symmetries appropriate for a (cylindrical) PET scanner, and a discretised density on a Cartesian grid...
Definition: DataSymmetriesForBins_PET_CartesianGrid.h:49
A class for encoding/finding symmetries. Works only on ViewSegmentNumbers (instead of Bin)...
Definition: DataSymmetriesForViewSegmentNumbers.h:49
alias for ViewgramIndices
Definition: ViewSegmentNumbers.h:33
A class for storing coordinates and value of a single projection bin.
Definition: Bin.h:48
Declaration of class stir::Bin.
projection data info for data corresponding to a &#39;cylindrical&#39; sampling.
Definition: ProjDataInfoCylindrical.h:48
inline implementations for class stir::DataSymmetriesForBins_PET_CartesianGrid