STIR  6.2.0
SymmetryOperations_PET_CartesianGrid.h
Go to the documentation of this file.
1 //
2 //
31 /*
32  Copyright (C) 2000 PARAPET partners
33  Copyright (C) 2000- 2009, Hammersmith Imanet Ltd
34  This file is part of STIR.
35 
36  SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
37 
38  See STIR/LICENSE.txt for details
39 */
40 
41 #ifndef __SymmetryOperations_PET_CartesianGrid_H__
42 #define __SymmetryOperations_PET_CartesianGrid_H__
43 
45 
46 START_NAMESPACE_STIR
47 
48 class SymmetryOperation_PET_CartesianGrid_z_shift : public SymmetryOperation
49 {
50 private:
51  typedef SymmetryOperation_PET_CartesianGrid_z_shift self;
52 
53 public:
54  SymmetryOperation_PET_CartesianGrid_z_shift(const int axial_pos_shift, const int z_shift)
55  : axial_pos_shift(axial_pos_shift),
56  z_shift(z_shift)
57  {}
58 
59  inline void transform_bin_coordinates(Bin&) const override;
60  inline void transform_view_segment_indices(ViewSegmentNumbers&) const override;
61  inline void transform_image_coordinates(BasicCoordinate<3, int>& c) const override;
62 
63  void transform_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin& lor) const override;
64 
65  void transform_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel&) const override;
66 
67 private:
68  int axial_pos_shift;
69  int z_shift;
70 };
71 
72 class SymmetryOperation_PET_CartesianGrid_swap_xmx_zq : public SymmetryOperation
73 {
74 private:
75  typedef SymmetryOperation_PET_CartesianGrid_swap_xmx_zq self;
76 
77 public:
78  SymmetryOperation_PET_CartesianGrid_swap_xmx_zq(const int num_views, const int axial_pos_shift, const int z_shift, const int q)
79  : view180(num_views),
80  axial_pos_shift(axial_pos_shift),
81  z_shift(z_shift),
82  q(q)
83  {}
84 
85  inline void transform_bin_coordinates(Bin&) const override;
86  inline void transform_view_segment_indices(ViewSegmentNumbers&) const override;
87  inline void transform_image_coordinates(BasicCoordinate<3, int>& c) const override;
88 
89  void transform_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin& lor) const override;
90 
91  void transform_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel&) const override;
92 
93 private:
94  int view180;
95  int axial_pos_shift;
96  int z_shift;
97  int q;
98 };
99 
101 
102 class SymmetryOperation_PET_CartesianGrid_swap_xmy_yx_zq : public SymmetryOperation
103 {
104 private:
105  typedef SymmetryOperation_PET_CartesianGrid_swap_xmy_yx_zq self;
106 
107 public:
108  SymmetryOperation_PET_CartesianGrid_swap_xmy_yx_zq(const int num_views,
109  const int axial_pos_shift,
110  const int z_shift,
111  const int q)
112  : view180(num_views),
113  axial_pos_shift(axial_pos_shift),
114  z_shift(z_shift),
115  q(q)
116  {}
117 
118  inline void transform_bin_coordinates(Bin&) const override;
119  inline void transform_view_segment_indices(ViewSegmentNumbers&) const override;
120  inline void transform_image_coordinates(BasicCoordinate<3, int>& c) const override;
121 
122  void transform_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin& lor) const override;
123 
124  void transform_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel&) const override;
125 
126 private:
127  int view180;
128  int axial_pos_shift;
129  int z_shift;
130  int q;
131 };
132 
133 class SymmetryOperation_PET_CartesianGrid_swap_xy_yx_zq : public SymmetryOperation
134 {
135 private:
136  typedef SymmetryOperation_PET_CartesianGrid_swap_xy_yx_zq self;
137 
138 public:
139  SymmetryOperation_PET_CartesianGrid_swap_xy_yx_zq(const int num_views,
140  const int axial_pos_shift,
141  const int z_shift,
142  const int q)
143  : view180(num_views),
144  axial_pos_shift(axial_pos_shift),
145  z_shift(z_shift),
146  q(q)
147  {}
148 
149  inline void transform_bin_coordinates(Bin&) const override;
150  inline void transform_view_segment_indices(ViewSegmentNumbers&) const override;
151  inline void transform_image_coordinates(BasicCoordinate<3, int>& c) const override;
152 
153  void transform_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin& lor) const override;
154 
155  void transform_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel&) const override;
156 
157 private:
158  int view180;
159  int axial_pos_shift;
160  int z_shift;
161  int q;
162 };
163 
164 class SymmetryOperation_PET_CartesianGrid_swap_xmy_yx : public SymmetryOperation
165 {
166 private:
167  typedef SymmetryOperation_PET_CartesianGrid_swap_xmy_yx self;
168 
169 public:
170  SymmetryOperation_PET_CartesianGrid_swap_xmy_yx(const int num_views, const int axial_pos_shift, const int z_shift)
171  : view180(num_views),
172  axial_pos_shift(axial_pos_shift),
173  z_shift(z_shift)
174  {}
175 
176  inline void transform_bin_coordinates(Bin&) const override;
177  inline void transform_view_segment_indices(ViewSegmentNumbers&) const override;
178  inline void transform_image_coordinates(BasicCoordinate<3, int>& c) const override;
179 
180  void transform_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin& lor) const override;
181 
182  void transform_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel&) const override;
183 
184 private:
185  int view180;
186  int axial_pos_shift;
187  int z_shift;
188 };
189 
190 class SymmetryOperation_PET_CartesianGrid_swap_xy_yx : public SymmetryOperation
191 {
192 private:
193  typedef SymmetryOperation_PET_CartesianGrid_swap_xy_yx self;
194 
195 public:
196  SymmetryOperation_PET_CartesianGrid_swap_xy_yx(const int num_views, const int axial_pos_shift, const int z_shift)
197  : view180(num_views),
198  axial_pos_shift(axial_pos_shift),
199  z_shift(z_shift)
200  {}
201 
202  inline void transform_bin_coordinates(Bin&) const override;
203  inline void transform_view_segment_indices(ViewSegmentNumbers&) const override;
204  inline void transform_image_coordinates(BasicCoordinate<3, int>& c) const override;
205 
206  void transform_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin& lor) const override;
207 
208  void transform_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel&) const override;
209 
210 private:
211  int view180;
212  int axial_pos_shift;
213  int z_shift;
214 };
215 
216 class SymmetryOperation_PET_CartesianGrid_swap_xmx : public SymmetryOperation
217 {
218 private:
219  typedef SymmetryOperation_PET_CartesianGrid_swap_xmx self;
220 
221 public:
222  SymmetryOperation_PET_CartesianGrid_swap_xmx(const int num_views, const int axial_pos_shift, const int z_shift)
223  : view180(num_views),
224  axial_pos_shift(axial_pos_shift),
225  z_shift(z_shift)
226  {}
227 
228  inline void transform_bin_coordinates(Bin&) const override;
229  inline void transform_view_segment_indices(ViewSegmentNumbers&) const override;
230  inline void transform_image_coordinates(BasicCoordinate<3, int>& c) const override;
231 
232  void transform_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin& lor) const override;
233 
234  void transform_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel&) const override;
235 
236 private:
237  int view180;
238  int axial_pos_shift;
239  int z_shift;
240 };
241 
242 class SymmetryOperation_PET_CartesianGrid_swap_ymy : public SymmetryOperation
243 {
244 private:
245  typedef SymmetryOperation_PET_CartesianGrid_swap_ymy self;
246 
247 public:
248  SymmetryOperation_PET_CartesianGrid_swap_ymy(const int num_views, const int axial_pos_shift, const int z_shift)
249  : view180(num_views),
250  axial_pos_shift(axial_pos_shift),
251  z_shift(z_shift)
252  {}
253 
254  inline void transform_bin_coordinates(Bin&) const override;
255  inline void transform_view_segment_indices(ViewSegmentNumbers&) const override;
256  inline void transform_image_coordinates(BasicCoordinate<3, int>& c) const override;
257 
258  void transform_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin& lor) const override;
259 
260  void transform_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel&) const override;
261 
262 private:
263  int view180;
264  int axial_pos_shift;
265  int z_shift;
266 };
267 
268 class SymmetryOperation_PET_CartesianGrid_swap_zq : public SymmetryOperation
269 {
270 private:
271  typedef SymmetryOperation_PET_CartesianGrid_swap_zq self;
272 
273 public:
274  SymmetryOperation_PET_CartesianGrid_swap_zq(const int num_views, const int axial_pos_shift, const int z_shift, const int q)
275  : view180(num_views),
276  axial_pos_shift(axial_pos_shift),
277  z_shift(z_shift),
278  q(q)
279  {}
280 
281  inline void transform_bin_coordinates(Bin&) const override;
282  inline void transform_view_segment_indices(ViewSegmentNumbers&) const override;
283  inline void transform_image_coordinates(BasicCoordinate<3, int>& c) const override;
284 
285  void transform_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin& lor) const override;
286 
287  void transform_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel&) const override;
288 
289 private:
290  int view180;
291  int axial_pos_shift;
292  int z_shift;
293  int q;
294 };
295 
296 class SymmetryOperation_PET_CartesianGrid_swap_xmx_ymy_zq : public SymmetryOperation
297 {
298 private:
299  typedef SymmetryOperation_PET_CartesianGrid_swap_xmx_ymy_zq self;
300 
301 public:
302  SymmetryOperation_PET_CartesianGrid_swap_xmx_ymy_zq(const int num_views,
303  const int axial_pos_shift,
304  const int z_shift,
305  const int q)
306  : view180(num_views),
307  axial_pos_shift(axial_pos_shift),
308  z_shift(z_shift),
309  q(q)
310  {}
311 
312  inline void transform_bin_coordinates(Bin&) const override;
313  inline void transform_view_segment_indices(ViewSegmentNumbers&) const override;
314  inline void transform_image_coordinates(BasicCoordinate<3, int>& c) const override;
315 
316  void transform_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin& lor) const override;
317 
318  void transform_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel&) const override;
319 
320 private:
321  int view180;
322  int axial_pos_shift;
323  int z_shift;
324  int q;
325 };
326 
327 class SymmetryOperation_PET_CartesianGrid_swap_xy_ymx_zq : public SymmetryOperation
328 {
329 private:
330  typedef SymmetryOperation_PET_CartesianGrid_swap_xy_ymx_zq self;
331 
332 public:
333  SymmetryOperation_PET_CartesianGrid_swap_xy_ymx_zq(const int num_views,
334  const int axial_pos_shift,
335  const int z_shift,
336  const int q)
337  : view180(num_views),
338  axial_pos_shift(axial_pos_shift),
339  z_shift(z_shift),
340  q(q)
341  {}
342 
343  inline void transform_bin_coordinates(Bin&) const override;
344  inline void transform_view_segment_indices(ViewSegmentNumbers&) const override;
345  inline void transform_image_coordinates(BasicCoordinate<3, int>& c) const override;
346 
347  void transform_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin& lor) const override;
348 
349  void transform_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel&) const override;
350 
351 private:
352  int view180;
353  int axial_pos_shift;
354  int z_shift;
355  int q;
356 };
357 
358 class SymmetryOperation_PET_CartesianGrid_swap_xy_ymx : public SymmetryOperation
359 {
360 private:
361  typedef SymmetryOperation_PET_CartesianGrid_swap_xy_ymx self;
362 
363 public:
364  SymmetryOperation_PET_CartesianGrid_swap_xy_ymx(const int num_views, const int axial_pos_shift, const int z_shift)
365  : view180(num_views),
366  axial_pos_shift(axial_pos_shift),
367  z_shift(z_shift)
368  {}
369 
370  inline void transform_bin_coordinates(Bin&) const override;
371  inline void transform_view_segment_indices(ViewSegmentNumbers&) const override;
372  inline void transform_image_coordinates(BasicCoordinate<3, int>& c) const override;
373 
374  void transform_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin& lor) const override;
375 
376  void transform_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel&) const override;
377 
378 private:
379  int view180;
380  int axial_pos_shift;
381  int z_shift;
382 };
383 
384 class SymmetryOperation_PET_CartesianGrid_swap_xmy_ymx : public SymmetryOperation
385 {
386 private:
387  typedef SymmetryOperation_PET_CartesianGrid_swap_xmy_ymx self;
388 
389 public:
390  SymmetryOperation_PET_CartesianGrid_swap_xmy_ymx(const int num_views, const int axial_pos_shift, const int z_shift)
391  : view180(num_views),
392  axial_pos_shift(axial_pos_shift),
393  z_shift(z_shift)
394  {}
395 
396  inline void transform_bin_coordinates(Bin&) const override;
397  inline void transform_view_segment_indices(ViewSegmentNumbers&) const override;
398  inline void transform_image_coordinates(BasicCoordinate<3, int>& c) const override;
399 
400  void transform_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin& lor) const override;
401 
402  void transform_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel&) const override;
403 
404 private:
405  int view180;
406  int axial_pos_shift;
407  int z_shift;
408 };
409 
410 class SymmetryOperation_PET_CartesianGrid_swap_ymy_zq : public SymmetryOperation
411 {
412 private:
413  typedef SymmetryOperation_PET_CartesianGrid_swap_ymy_zq self;
414 
415 public:
416  SymmetryOperation_PET_CartesianGrid_swap_ymy_zq(const int num_views, const int axial_pos_shift, const int z_shift, const int q)
417  : view180(num_views),
418  axial_pos_shift(axial_pos_shift),
419  z_shift(z_shift),
420  q(q)
421  {}
422 
423  inline void transform_bin_coordinates(Bin&) const override;
424  inline void transform_view_segment_indices(ViewSegmentNumbers&) const override;
425  inline void transform_image_coordinates(BasicCoordinate<3, int>& c) const override;
426 
427  void transform_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin& lor) const override;
428 
429  void transform_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel&) const override;
430 
431 private:
432  int view180;
433  int axial_pos_shift;
434  int z_shift;
435  int q;
436 };
437 
438 class SymmetryOperation_PET_CartesianGrid_swap_xmx_ymy : public SymmetryOperation
439 {
440 private:
441  typedef SymmetryOperation_PET_CartesianGrid_swap_xmx_ymy self;
442 
443 public:
444  SymmetryOperation_PET_CartesianGrid_swap_xmx_ymy(const int num_views, const int axial_pos_shift, const int z_shift)
445  : view180(num_views),
446  axial_pos_shift(axial_pos_shift),
447  z_shift(z_shift)
448  {}
449 
450  inline void transform_bin_coordinates(Bin&) const override;
451  inline void transform_view_segment_indices(ViewSegmentNumbers&) const override;
452  inline void transform_image_coordinates(BasicCoordinate<3, int>& c) const override;
453 
454  void transform_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin& lor) const override;
455 
456  void transform_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel&) const override;
457 
458 private:
459  int view180;
460  int axial_pos_shift;
461  int z_shift;
462 };
463 
464 class SymmetryOperation_PET_CartesianGrid_swap_xmy_ymx_zq : public SymmetryOperation
465 {
466 private:
467  typedef SymmetryOperation_PET_CartesianGrid_swap_xmy_ymx_zq self;
468 
469 public:
470  SymmetryOperation_PET_CartesianGrid_swap_xmy_ymx_zq(const int num_views,
471  const int axial_pos_shift,
472  const int z_shift,
473  const int q)
474  : view180(num_views),
475  axial_pos_shift(axial_pos_shift),
476  z_shift(z_shift),
477  q(q)
478  {}
479 
480  inline void transform_bin_coordinates(Bin&) const override;
481  inline void transform_view_segment_indices(ViewSegmentNumbers&) const override;
482  inline void transform_image_coordinates(BasicCoordinate<3, int>& c) const override;
483 
484  void transform_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin& lor) const override;
485 
486  void transform_proj_matrix_elems_for_one_densel(ProjMatrixElemsForOneDensel&) const override;
487 
488 private:
489  int view180;
490  int axial_pos_shift;
491  int z_shift;
492  int q;
493 };
494 
495 END_NAMESPACE_STIR
496 
498 
499 #endif
Implementation of all symmetry classes for PET scanners and cartesian images.
Declaration of 2 classes: stir::SymmetryOperation and stir::TrivialSymmetryOperation.