STIR  6.2.0
FBP3DRPReconstruction.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2000 PARAPET partners
5  Copyright (C) 2000- 2007, Hammersmith Imanet Ltd
6 
7  This file is part of STIR.
8 
9  SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
10 
11  See STIR/LICENSE.txt for details
12 */
22 #ifndef __stir_analytic_FBP3DRP_FBP3DRPRECONSTRUCTION_H__
23 #define __stir_analytic_FBP3DRP_FBP3DRPRECONSTRUCTION_H__
24 
30 #include "stir/ArcCorrection.h"
31 #include "stir/shared_ptr.h"
33 
34 START_NAMESPACE_STIR
35 
36 template <typename elemT>
38 template <typename elemT>
39 class Sinogram;
40 template <typename elemT>
42 template <typename elemT>
44 template <int num_dimensions, typename elemT>
45 class DiscretisedDensity;
46 class Succeeded;
47 
48 /* KT 180899 forget about PETAnalyticReconstruction for the moment
49  TODO Derive from PETAnalyticReconstruction when it makes any sense
50  */
92  : public RegisteredParsingObject<FBP3DRPReconstruction, Reconstruction<DiscretisedDensity<3, float>>, AnalyticReconstruction>
93 {
94  // typedef AnalyticReconstruction base_type;
96  base_type;
97 
98 public:
100  static const char* const registered_name;
101 
104 
109  explicit FBP3DRPReconstruction(const std::string& parameter_filename);
110 
111  // explicitly implement destructor (NOT inline) to avoid funny problems with
112  // the shared_ptr<DiscretisedDensity<3,float> > destructor with gcc.
113  // Otherwise, gcc will complain if you didn't include DiscretisedDensity.h
114  // because it doesn't know ~DiscretisedDensity.
115  ~FBP3DRPReconstruction() override;
116 
118  std::string method_info() const override;
119 
120  Succeeded set_up(shared_ptr<DiscretisedDensity<3, float>> const& target_image_sptr) override;
121 
122 protected:
131  Succeeded actual_reconstruct(shared_ptr<DiscretisedDensity<3, float>> const&) override;
132 
134  void do_best_fit(const Sinogram<float>& sino_measured, const Sinogram<float>& sino_calculated);
135 
137  void do_2D_reconstruction();
138 
140  void do_save_img(const char* file, const VoxelsOnCartesianGrid<float>& data) const;
141 
143  void do_read_image2D();
144 
146  void do_3D_Reconstruction(VoxelsOnCartesianGrid<float>& image);
147 
149  void do_arc_correction(RelatedViewgrams<float>& viewgrams) const;
150 
152  void do_grow3D_viewgram(RelatedViewgrams<float>& viewgrams, int rmin, int rmax);
154  void
155  do_forward_project_view(RelatedViewgrams<float>& viewgrams, int rmin, int rmax, int orig_min_ring, int orig_max_ring) const;
157  void do_colsher_filter_view(RelatedViewgrams<float>& viewgrams);
159  void do_3D_backprojection_view(RelatedViewgrams<float> const& viewgrams, int rmin, int rmax);
161  void do_log_file(const VoxelsOnCartesianGrid<float>& image);
162 
163  virtual void do_byview_initialise(const VoxelsOnCartesianGrid<float>& image) const {};
164 
165  virtual void do_byview_finalise(VoxelsOnCartesianGrid<float>& image){};
166 
167 public:
168  // KT 230899 this has to be public to let the Para stuff access it (sadly)
169 
170  virtual void do_process_viewgrams(RelatedViewgrams<float>& viewgrams, int rmin, int rmax, int orig_min_ring, int orig_max_ring);
171 
172  // parameters stuff
173 public:
174  void ask_parameters();
175 
176 protected:
179 
182 
184 
192 
194 
196 
198  int PadS;
200  int PadZ;
202  double alpha_ramp;
204  double fc_ramp;
205 
218 
221 
222 private:
223  void set_defaults() override;
224  void initialise_keymap() override;
225 
227  const ProjDataInfoCylindrical& input_proj_data_info_cyl() const;
229  shared_ptr<ProjDataInfo> proj_data_info_with_missing_data_sptr;
230 
231  shared_ptr<DiscretisedDensity<3, float>> image_estimate_density_ptr;
232  // convenience access functions to the above member
233  inline VoxelsOnCartesianGrid<float>& estimated_image();
234  inline const VoxelsOnCartesianGrid<float>& estimated_image() const;
235 
236  shared_ptr<ForwardProjectorByBin> forward_projector_sptr;
237  shared_ptr<BackProjectorByBin> back_projector_sptr;
238 #ifndef NRFFT
239  ColsherFilter colsher_filter;
240 #endif
241  float alpha_fit;
242  float beta_fit;
243 
244  shared_ptr<ArcCorrection> arc_correction_sptr;
245 };
246 
247 END_NAMESPACE_STIR
248 
249 #endif
base class for all analytic reconstruction algorithmsThis class provides extra functinoality (compare...
Definition: AnalyticReconstruction.h:50
This class is used to represent voxelised densities on a cuboid grid (3D).
Definition: FBP3DRPReconstruction.h:43
std::string image_for_reprojection_filename
Filename of image used in the reprojection step (default is empty)
Definition: FBP3DRPReconstruction.h:191
A class for 2d projection data.
Definition: FBP3DRPReconstruction.h:39
double alpha_ramp
Ramp filter: Alpha value.
Definition: FBP3DRPReconstruction.h:202
A class for storing viewgrams which are related by symmetry.
Definition: FBP3DRPReconstruction.h:37
A class for storing (3d) projection data with fixed SegmentIndices.
Definition: FBP3DRPReconstruction.h:41
Colsher filter class.
double fc_colsher_axial
Cut-off frequency for Colsher filter in axial direction.
Definition: FBP3DRPReconstruction.h:209
int display_level
Switch to display intermediate images, 0,1,2.
Definition: FBP3DRPReconstruction.h:178
int PadS
Transaxial extension for FFT.
Definition: FBP3DRPReconstruction.h:198
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast (or corresponding b...
double alpha_colsher_axial
Alpha parameter for Colsher filter in axial direction.
Definition: FBP3DRPReconstruction.h:207
Declaration of class stir::ProjDataInfoCylindrical.
int save_intermediate_files
Switch to save files after each segment, 0 or 1.
Definition: FBP3DRPReconstruction.h:181
static const char *const registered_name
Name which will be used when parsing a ProjectorByBinPair object.
Definition: FBP3DRPReconstruction.h:100
int num_segments_to_combine
Number of segments to combine with SSRB before calling FBP.
Definition: FBP3DRPReconstruction.h:195
This class contains the Colsher filter used for 3D-PET reconstruction.
Definition: ColsherFilter.h:45
double fc_colsher_planar
Cut-off frequency for Colsher filter in planar direction.
Definition: FBP3DRPReconstruction.h:213
int PadZ
Axial extension for FFT.
Definition: FBP3DRPReconstruction.h:200
declares the stir::AnalyticReconstruction class
int colsher_stretch_factor_planar
Define Colsher at larger size than used for filtering, planar direction.
Definition: FBP3DRPReconstruction.h:217
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files...
Definition: RegisteredParsingObject.h:77
Declaration of class stir::ArcCorrection.
Base class for forward projectors which work on &#39;large&#39; collections of bins: given the whole image...
int fit_projections
=1 => apply additional fitting procedure to forward projected data (DISABLED)
Definition: FBP3DRPReconstruction.h:220
double alpha_colsher_planar
Alpha parameter for Colsher filter in planar direction.
Definition: FBP3DRPReconstruction.h:211
double fc_ramp
Ramp filter: Cut off frequency.
Definition: FBP3DRPReconstruction.h:204
projection data info for data corresponding to a &#39;cylindrical&#39; sampling.
Definition: ProjDataInfoCylindrical.h:48
int colsher_stretch_factor_axial
Define Colsher at larger size than used for filtering, axial direction.
Definition: FBP3DRPReconstruction.h:215
Declares class stir::BackProjectorByBin.
This class contains the implementation of the FBP3DRP algorithm.
Definition: FBP3DRPReconstruction.h:91
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
Declaration of class stir::RegisteredParsingObject.
This abstract class is the basis for all image representations.
Definition: FBP2DReconstruction.h:35