STIR 6.4.0
ProjMatrixByBinUsingInterpolation.h
Go to the documentation of this file.
1//
2//
3/*
4 Copyright (C) 2000- 2008, Hammersmith Imanet Ltd
5 This file is part of STIR.
6
7 SPDX-License-Identifier: Apache-2.0
8
9 See STIR/LICENSE.txt for details
10*/
20#ifndef __stir_recon_buildblock_ProjMatrixByBinUsingInterpolation__
21#define __stir_recon_buildblock_ProjMatrixByBinUsingInterpolation__
22
27#include "stir/shared_ptr.h"
28
29START_NAMESPACE_STIR
30
31template <int num_dimensions, typename elemT>
32class DiscretisedDensity;
33class Bin;
49
51 : public RegisteredParsingObject<ProjMatrixByBinUsingInterpolation, ProjMatrixByBin, ProjMatrixByBin>
52{
53public:
55 static const char* const registered_name;
56
59
61
63 void set_up(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr,
64 const shared_ptr<const DiscretisedDensity<3, float>>& density_info_ptr // TODO should be Info only
65 ) override;
66
67 ProjMatrixByBinUsingInterpolation* clone() const override;
68
69private:
70 bool do_symmetry_90degrees_min_phi;
71 bool do_symmetry_180degrees_min_phi;
72 bool do_symmetry_swap_segment;
73 bool do_symmetry_swap_s;
74 bool do_symmetry_shift_z;
75
76 // explicitly list necessary members for image details (should use an Info object instead)
79 IndexRange<3> densel_range;
80
81 shared_ptr<const ProjDataInfo> proj_data_info_ptr;
82
83 // for Jacobian
84 const ProjDataInfoCylindrical& proj_data_info_cyl() const
85 {
86 return static_cast<const ProjDataInfoCylindrical&>(*proj_data_info_ptr);
87 }
103
104 class JacobianForIntBP
105 {
106 private:
107 // store some scanner related data to avoid recomputation
108 float R2;
109 float ring_spacing2;
110 bool arccor;
111 // total normalisation of backprojection, 3 factors:
112 // (_Pi/scanner.num_views) for discretisation of integral over phi
113 // scanner.ring_spacing for discretisation of integral over delta
114 // normalisation of projection space integral: 1/(2 Pi)
115
116 float backprojection_normalisation;
117
118 bool use_exact_Jacobian_now;
119
120 public:
121 // default constructor needed as now member of projector class (better to make set_up)
123 explicit JacobianForIntBP(const ProjDataInfoCylindrical* proj_data_info_ptr, bool exact);
124 // s in mm here!
125 float operator()(const float delta, const float s) const
126 {
127 float tmp;
128 if (use_exact_Jacobian_now)
129 tmp = 4 * (R2 - s * s);
130 else
131 tmp = 4 * R2;
132 if (!arccor)
133 tmp *= sqrt(tmp);
134 return (arccor ? tmp : pow(tmp, 1.5F)) / pow(tmp + ring_spacing2 * delta * delta, 1.5F) * backprojection_normalisation;
135 }
136 };
137
138 JacobianForIntBP jacobian;
139 bool use_piecewise_linear_interpolation_now;
140 bool use_exact_Jacobian_now;
141
142 void calculate_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin&) const override;
143
144 void set_defaults() override;
145 void initialise_keymap() override;
146 bool post_processing() override;
147
148 float get_element(const Bin& bin, const CartesianCoordinate3D<float>& densel_ctr) const;
149
150private:
151 void find_tang_ax_pos_diff(float& tang_pos_diff,
152 float& ax_pos_diff,
153 const Bin& bin,
154 const CartesianCoordinate3D<float>& point) const;
155};
156
157END_NAMESPACE_STIR
158
159#endif
defines the stir::CartesianCoordinate3D<coordT> class
Declaration of class stir::ProjDataInfoCylindrical.
declaration of stir::ProjMatrixByBin and its helpers classes
Declaration of class stir::RegisteredParsingObject.
a templated class for 3-dimensional coordinates.
Definition CartesianCoordinate3D.h:53
This abstract class is the basis for all image representations.
Definition DiscretisedDensity.h:99
This class defines ranges which can be 'irregular'.
Definition IndexRange.h:69
The next class is used in BackProjectorByBinUsingInterpolation to take geometric things into account....
Definition BackProjectorByBinUsingInterpolation.h:58
projection data info for data corresponding to a 'cylindrical' sampling.
Definition ProjDataInfoCylindrical.h:49
static const char *const registered_name
Name which will be used when parsing a ProjMatrixByBin object.
Definition ProjMatrixByBinUsingInterpolation.h:55
void set_up(const shared_ptr< const ProjDataInfo > &proj_data_info_ptr, const shared_ptr< const DiscretisedDensity< 3, float > > &density_info_ptr) override
Stores all necessary geometric info.
Definition ProjMatrixByBinUsingInterpolation.cxx:95
ProjMatrixByBinUsingInterpolation()
Default constructor (calls set_defaults())
Definition ProjMatrixByBinUsingInterpolation.cxx:52
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files.
Definition RegisteredParsingObject.h:78
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast into the stir names...