STIR 6.4.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*/
21
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
34START_NAMESPACE_STIR
35
36template <typename elemT>
37class RelatedViewgrams;
38template <typename elemT>
39class Sinogram;
40template <typename elemT>
41class SegmentBySinogram;
42template <typename elemT>
43class VoxelsOnCartesianGrid;
44template <int num_dimensions, typename elemT>
45class DiscretisedDensity;
46class 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
98public:
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
122protected:
130
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
138
140 void do_save_img(const char* file, const VoxelsOnCartesianGrid<float>& data) const;
141
143 void do_read_image2D();
144
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;
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
167public:
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
173public:
174 void ask_parameters();
175
176protected:
179
182
184
192
194
196
198 int PadS;
200 int PadZ;
204 double fc_ramp;
205
218
221
222private:
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
247END_NAMESPACE_STIR
248
249#endif
declares the stir::AnalyticReconstruction class
Declaration of class stir::ArcCorrection.
Declares class stir::BackProjectorByBin.
Colsher filter class.
Base class for forward projectors which work on 'large' collections of bins: given the whole image,...
Declaration of class stir::ProjDataInfoCylindrical.
Declaration of class stir::RegisteredParsingObject.
base class for all analytic reconstruction algorithmsThis class provides extra functinoality (compare...
Definition AnalyticReconstruction.h:51
This class contains the Colsher filter used for 3D-PET reconstruction.
Definition ColsherFilter.h:52
This abstract class is the basis for all image representations.
Definition DiscretisedDensity.h:99
int num_segments_to_combine
Number of segments to combine with SSRB before calling FBP.
Definition FBP3DRPReconstruction.h:195
int fit_projections
=1 => apply additional fitting procedure to forward projected data (DISABLED)
Definition FBP3DRPReconstruction.h:220
void do_best_fit(const Sinogram< float > &sino_measured, const Sinogram< float > &sino_calculated)
Best fit of forward projected sinograms.
Definition FBP3DRPReconstruction.cxx:686
double fc_ramp
Ramp filter: Cut off frequency.
Definition FBP3DRPReconstruction.h:204
void do_colsher_filter_view(RelatedViewgrams< float > &viewgrams)
Apply Colsher filter to 8 viewgrams.
Definition FBP3DRPReconstruction.cxx:797
int colsher_stretch_factor_axial
Define Colsher at larger size than used for filtering, axial direction.
Definition FBP3DRPReconstruction.h:215
double alpha_ramp
Ramp filter: Alpha value.
Definition FBP3DRPReconstruction.h:202
void do_grow3D_viewgram(RelatedViewgrams< float > &viewgrams, int rmin, int rmax)
Growing 8 viewgrams in both ring and bin directions.
Definition FBP3DRPReconstruction.cxx:736
void do_3D_backprojection_view(RelatedViewgrams< float > const &viewgrams, int rmin, int rmax)
3D backprojection implentation for 8 viewgrams.
Definition FBP3DRPReconstruction.cxx:889
int PadZ
Axial extension for FFT.
Definition FBP3DRPReconstruction.h:200
void do_read_image2D()
Read image estimated from 2D FBP.
Definition FBP3DRPReconstruction.cxx:583
void do_arc_correction(RelatedViewgrams< float > &viewgrams) const
Arc-correction viewgrams.
Definition FBP3DRPReconstruction.cxx:726
Succeeded actual_reconstruct(shared_ptr< DiscretisedDensity< 3, float > > const &) override
Implementation of the reconstruction.
Definition FBP3DRPReconstruction.cxx:364
void do_log_file(const VoxelsOnCartesianGrid< float > &image)
Saving CPU timing and values of reconstruction parameters into a log file.
Definition FBP3DRPReconstruction.cxx:899
double fc_colsher_planar
Cut-off frequency for Colsher filter in planar direction.
Definition FBP3DRPReconstruction.h:213
double fc_colsher_axial
Cut-off frequency for Colsher filter in axial direction.
Definition FBP3DRPReconstruction.h:209
int PadS
Transaxial extension for FFT.
Definition FBP3DRPReconstruction.h:198
int save_intermediate_files
Switch to save files after each segment, 0 or 1.
Definition FBP3DRPReconstruction.h:181
int display_level
Switch to display intermediate images, 0,1,2.
Definition FBP3DRPReconstruction.h:178
FBP3DRPReconstruction()
Default constructor (calls set_defaults())
Definition FBP3DRPReconstruction.cxx:333
void do_save_img(const char *file, const VoxelsOnCartesianGrid< float > &data) const
Save image data.
Definition FBP3DRPReconstruction.cxx:575
static const char *const registered_name
Name which will be used when parsing a ProjectorByBinPair object.
Definition FBP3DRPReconstruction.h:100
double alpha_colsher_axial
Alpha parameter for Colsher filter in axial direction.
Definition FBP3DRPReconstruction.h:207
double alpha_colsher_planar
Alpha parameter for Colsher filter in planar direction.
Definition FBP3DRPReconstruction.h:211
std::string method_info() const override
This method returns the type of the reconstruction algorithm during the reconstruction,...
Definition FBP3DRPReconstruction.cxx:302
void do_forward_project_view(RelatedViewgrams< float > &viewgrams, int rmin, int rmax, int orig_min_ring, int orig_max_ring) const
3D forward projection implentation by view.
Definition FBP3DRPReconstruction.cxx:752
void do_2D_reconstruction()
2D FBP implementation.
Definition FBP3DRPReconstruction.cxx:540
int colsher_stretch_factor_planar
Define Colsher at larger size than used for filtering, planar direction.
Definition FBP3DRPReconstruction.h:217
void do_3D_Reconstruction(VoxelsOnCartesianGrid< float > &image)
3D reconstruction implementation.
Definition FBP3DRPReconstruction.cxx:593
std::string image_for_reprojection_filename
Filename of image used in the reprojection step (default is empty)
Definition FBP3DRPReconstruction.h:191
projection data info for data corresponding to a 'cylindrical' sampling.
Definition ProjDataInfoCylindrical.h:49
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files.
Definition RegisteredParsingObject.h:78
A class for storing viewgrams which are related by symmetry.
Definition RelatedViewgrams.h:41
A class for 2d projection data.
Definition Sinogram.h:47
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition Succeeded.h:44
This class is used to represent voxelised densities on a cuboid grid (3D).
Definition VoxelsOnCartesianGrid.h:46
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast into the stir names...