|
STIR 6.5.0
|
This class contains the implementation of the FBP3DRP algorithm. More...
#include "stir/analytic/FBP3DRP/FBP3DRPReconstruction.h"

Public Member Functions | |
| FBP3DRPReconstruction () | |
| Default constructor (calls set_defaults()). | |
| FBP3DRPReconstruction (const std::string ¶meter_filename) | |
| Constructor, initialises everything from parameter file, or (when parameter_filename == "") by calling ask_parameters(). | |
| std::string | method_info () const override |
| This method returns the type of the reconstruction algorithm during the reconstruction, here it is FBP3DRP. | |
| Succeeded | set_up (shared_ptr< DiscretisedDensity< 3, float > > const &target_image_sptr) override |
| virtual void | do_process_viewgrams (RelatedViewgrams< float > &viewgrams, int rmin, int rmax, int orig_min_ring, int orig_max_ring) |
| void | ask_parameters () |
| Public Member Functions inherited from stir::RegisteredParsingObject< FBP3DRPReconstruction, Reconstruction< DiscretisedDensity< 3, float > >, AnalyticReconstruction > | |
| std::string | get_registered_name () const override |
| Returns Derived::registered_name. | |
| std::string | parameter_info () override |
| Returns a string with all parameters and their values, in a form suitable for parsing again. | |
| Public Member Functions inherited from stir::AnalyticReconstruction | |
| virtual DiscretisedDensity< 3, float > * | construct_target_image_ptr () const |
| construct an image from parameters set (e.g. during parsing) | |
| Succeeded | reconstruct () override |
| reconstruct and write to file | |
| Succeeded | reconstruct (shared_ptr< TargetT > const &target_image_sptr) override |
executes the reconstruction storing result in target_image_sptr | |
| void | set_input_data (const shared_ptr< ExamData > &) override |
| set input data | |
| const ProjData & | get_input_data () const override |
| get input data | |
| int | get_output_image_size_xy () const |
| void | set_output_image_size_xy (int) |
| int | get_output_image_size_z () const |
| void | set_output_image_size_z (int) |
| float | get_zoom_xy () const |
| void | set_zoom_xy (float) |
| float | get_zoom_z () const |
| void | set_zoom_z (float) |
| const CartesianCoordinate3D< float > & | get_offset () const |
| void | set_offset (const CartesianCoordinate3D< float > &) |
| Public Member Functions inherited from stir::Reconstruction< DiscretisedDensity< 3, float > > | |
| Reconstruction () | |
| default constructor (calls set_defaults()) | |
| ~Reconstruction () override | |
| virtual destructor | |
| virtual Succeeded | set_up (shared_ptr< DiscretisedDensity< 3, float > > const &target_data_sptr) |
| operations prior to the reconstruction | |
| void | set_output_filename_prefix (const std::string &) |
| file name for output reconstructed images | |
| void | set_output_file_format_ptr (const shared_ptr< OutputFileFormat< DiscretisedDensity< 3, float > > > &) |
| defines the format of the output files | |
| void | set_post_processor_sptr (const shared_ptr< DataProcessor< DiscretisedDensity< 3, float > > > &) |
| post-filter | |
| void | set_disable_output (bool _val) |
| set_disable_output | |
| shared_ptr< DiscretisedDensity< 3, float > > | get_target_image () |
| get_reconstructed_image | |
| Public Member Functions inherited from stir::ParsingObject | |
| ParsingObject (const ParsingObject &) | |
| ParsingObject & | operator= (const ParsingObject &) |
| bool | parse (std::istream &f) |
| bool | parse (const char *const filename) |
| void | ask_parameters () |
| Public Member Functions inherited from stir::TimedObject | |
| void | reset_timers () |
| reset all timers kept by this object | |
| void | stop_timers () const |
| stop all timers kept by this object | |
| void | start_timers (bool do_reset=false) const |
| start all timers kept by this object | |
| double | get_CPU_timer_value () const |
| get current value of the CPU timer (since first use or last reset) | |
| double | get_wall_clock_timer_value () const |
| get current value of the wall-clock timer (since first use or last reset) | |
Static Public Attributes | |
| static const char *const | registered_name = "FBP3DRP" |
| Name which will be used when parsing a ProjectorByBinPair object. | |
Protected Member Functions | |
| Succeeded | actual_reconstruct (shared_ptr< DiscretisedDensity< 3, float > > const &) override |
| Implementation of the reconstruction. | |
| void | do_best_fit (const Sinogram< float > &sino_measured, const Sinogram< float > &sino_calculated) |
| Best fit of forward projected sinograms. | |
| void | do_2D_reconstruction () |
| 2D FBP implementation. | |
| void | do_save_img (const char *file, const VoxelsOnCartesianGrid< float > &data) const |
| Save image data. | |
| void | do_read_image2D () |
| Read image estimated from 2D FBP. | |
| void | do_3D_Reconstruction (VoxelsOnCartesianGrid< float > &image) |
| 3D reconstruction implementation. | |
| void | do_arc_correction (RelatedViewgrams< float > &viewgrams) const |
| Arc-correction viewgrams. | |
| void | do_grow3D_viewgram (RelatedViewgrams< float > &viewgrams, int rmin, int rmax) |
| Growing 8 viewgrams in both ring and bin directions. | |
| 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. | |
| void | do_colsher_filter_view (RelatedViewgrams< float > &viewgrams) |
| Apply Colsher filter to 8 viewgrams. | |
| void | do_3D_backprojection_view (RelatedViewgrams< float > const &viewgrams, int rmin, int rmax) |
| 3D backprojection implentation for 8 viewgrams. | |
| void | do_log_file (const VoxelsOnCartesianGrid< float > &image) |
| Saving CPU timing and values of reconstruction parameters into a log file. | |
| virtual void | do_byview_initialise (const VoxelsOnCartesianGrid< float > &image) const |
| virtual void | do_byview_finalise (VoxelsOnCartesianGrid< float > &image) |
| bool | post_processing () override |
| used to check acceptable parameter ranges, etc... | |
| virtual void | check (DiscretisedDensity< 3, float > const &target_data) const |
| do consistency checks | |
| void | initialise (const std::string ¶meter_filename) |
| This function initialises all parameters, either via parsing, or by calling ask_parameters() (when parameter_filename is the empty string). | |
| void | set_defaults () override |
| Set defaults before parsing. | |
| void | initialise_keymap () override |
| Initialise all keywords. | |
| bool | post_processing () override |
| used to check acceptable parameters after parsing | |
| virtual void | set_key_values () |
| This will be called before parsing or parameter_info is called. | |
Protected Attributes | |
| int | display_level |
| Switch to display intermediate images, 0,1,2. | |
| int | save_intermediate_files |
| Switch to save files after each segment, 0 or 1. | |
| std::string | image_for_reprojection_filename |
| Filename of image used in the reprojection step (default is empty). | |
| int | num_segments_to_combine |
| Number of segments to combine with SSRB before calling FBP. | |
| int | PadS |
| Transaxial extension for FFT. | |
| int | PadZ |
| Axial extension for FFT. | |
| double | alpha_ramp |
| Ramp filter: Alpha value. | |
| double | fc_ramp |
| Ramp filter: Cut off frequency. | |
| double | alpha_colsher_axial |
| Alpha parameter for Colsher filter in axial direction. | |
| double | fc_colsher_axial |
| Cut-off frequency for Colsher filter in axial direction. | |
| double | alpha_colsher_planar |
| Alpha parameter for Colsher filter in planar direction. | |
| double | fc_colsher_planar |
| Cut-off frequency for Colsher filter in planar direction. | |
| int | colsher_stretch_factor_axial |
| Define Colsher at larger size than used for filtering, axial direction. | |
| int | colsher_stretch_factor_planar |
| Define Colsher at larger size than used for filtering, planar direction. | |
| int | fit_projections |
| =1 => apply additional fitting procedure to forward projected data (DISABLED) | |
| std::string | input_filename |
| the input projection data file name | |
| int | max_segment_num_to_process |
| the maximum absolute ring difference number to use in the reconstruction | |
| shared_ptr< ProjData > | proj_data_ptr |
| points to the object for the total input projection data | |
| ParseAndCreateFrom< TargetT, ProjData > | target_parameter_parser |
| std::string | output_filename_prefix |
| file name for output reconstructed images | |
| shared_ptr< OutputFileFormat< DiscretisedDensity< 3, float > > > | output_file_format_ptr |
| defines the format of the output files | |
| shared_ptr< DataProcessor< DiscretisedDensity< 3, float > > > | post_filter_sptr |
| post-filter | |
| bool | _already_set_up |
| shared_ptr< DiscretisedDensity< 3, float > > | target_data_sptr |
| target_data_sptr | |
| bool | _disable_output |
| _disable_output | |
| int | _verbosity |
| Verbosity level. | |
| KeyParser | parser |
Additional Inherited Members | |
| Public Types inherited from stir::AnalyticReconstruction | |
| typedef DiscretisedDensity< 3, float > | TargetT |
| Static Public Member Functions inherited from stir::RegisteredParsingObject< FBP3DRPReconstruction, Reconstruction< DiscretisedDensity< 3, float > >, AnalyticReconstruction > | |
| static Reconstruction< DiscretisedDensity< 3, float > > * | read_from_stream (std::istream *) |
| Construct a new object (of type Derived) by parsing the istream. | |
| Static Public Member Functions inherited from stir::RegisteredObject< Reconstruction< DiscretisedDensity< 3, float > > > | |
| static Reconstruction< DiscretisedDensity< 3, float > > * | read_registered_object (std::istream *in, const std::string ®istered_name) |
| Construct a new object (of a type derived from Root, its actual type determined by the registered_name parameter) by parsing the istream. | |
| static Reconstruction< DiscretisedDensity< 3, float > > * | ask_type_and_parameters () |
| ask the user for the type, and then calls read_registered_object(0, type) | |
| static void | list_registered_names (std::ostream &stream) |
| List all possible registered names to the stream. | |
| Protected Types inherited from stir::RegisteredObject< Reconstruction< DiscretisedDensity< 3, float > > > | |
| typedef Reconstruction< DiscretisedDensity< 3, float > > *(*) | RootFactory(std::istream *) |
| The type of a root factory is a function, taking an istream* as argument, and returning a Root*. | |
| typedef FactoryRegistry< std::string, RootFactory, interfile_less > | RegistryType |
| The type of the registry. | |
| Static Protected Member Functions inherited from stir::RegisteredObject< Reconstruction< DiscretisedDensity< 3, float > > > | |
| static RegistryType & | registry () |
| Static function returning the registry. | |
This class contains the implementation of the FBP3DRP algorithm.
This class implements the 3DRP algorithm (Kinahan and Rogers) as a specific case of a 3D FBP reconstruction algorithm.
Some care is taken to achieve a fairly general implementation. For instance, the number of sinograms in the oblique segments is arbitrary (i.e. does not have to be related to what you would get from a cylindrical PET scanner). Also, scale factors are inserted such that the reconstructed image has (almost) the same scale independent of the number of segments that is used.
Nevertheless, this is an analytic algorithm, and it implements a discrete version of a continuous inversion formula. This will work best (but of course slowest) when the number of segments is large.
This implementation is specific for data using sampling corresponding to cylindrical PET scanners. This dependency essentially only occurs in the backprojection where a Jacobian is necessary in this case, and where the number of ring differences in each segment is taken into account. It would be not too difficult to make a version that works on e.g. spherical sampling.
| stir::FBP3DRPReconstruction::FBP3DRPReconstruction | ( | ) |
Default constructor (calls set_defaults()).
References FBP3DRPReconstruction().
Referenced by FBP3DRPReconstruction(), and FBP3DRPReconstruction().
|
explicit |
Constructor, initialises everything from parameter file, or (when parameter_filename == "") by calling ask_parameters().
References FBP3DRPReconstruction(), and stir::Reconstruction< DiscretisedDensity< 3, float > >::initialise().
|
overridevirtual |
This method returns the type of the reconstruction algorithm during the reconstruction, here it is FBP3DRP.
Implements stir::Reconstruction< DiscretisedDensity< 3, float > >.
References method_info().
Referenced by method_info().
|
overrideprotectedvirtual |
Implementation of the reconstruction.
This method implements the reconstruction by giving as input the emission sinogram data corrected for attenuation, scatter, dead time, and returns the output reconstructed image
Implements stir::AnalyticReconstruction.
References actual_reconstruct(), alpha_colsher_axial, alpha_colsher_planar, stir::Reconstruction< DiscretisedDensity< 3, float > >::check(), colsher_stretch_factor_axial, colsher_stretch_factor_planar, display_level, do_2D_reconstruction(), do_3D_Reconstruction(), do_best_fit(), do_log_file(), do_read_image2D(), stir::error(), fc_colsher_axial, fc_colsher_planar, stir::Array< num_dimensions, elemT >::find_max(), fit_projections, stir::DataWithProjDataInfo::get_proj_data_info_sptr(), image_for_reprojection_filename, stir::AnalyticReconstruction::max_segment_num_to_process, stir::Reconstruction< DiscretisedDensity< 3, float > >::output_filename_prefix, stir::RegisteredParsingObject< FBP3DRPReconstruction, Reconstruction< DiscretisedDensity< 3, float > >, AnalyticReconstruction >::parameter_info(), stir::AnalyticReconstruction::proj_data_ptr, and stir::warning().
Referenced by actual_reconstruct().
|
protected |
Best fit of forward projected sinograms.
References stir::determinant(), do_best_fit(), stir::Array< num_dimensions, elemT >::find_max(), stir::DataWithProjDataInfo::get_max_tangential_pos_num(), stir::DataWithProjDataInfo::get_max_view_num(), stir::DataWithProjDataInfo::get_min_tangential_pos_num(), stir::DataWithProjDataInfo::get_min_view_num(), stir::DataWithProjDataInfo::get_num_tangential_poss(), stir::DataWithProjDataInfo::get_num_views(), stir::Array< num_dimensions, elemT >::sum(), and stir::warning().
Referenced by actual_reconstruct(), and do_best_fit().
|
protected |
2D FBP implementation.
References stir::Reconstruction< DiscretisedDensity< 3, float > >::_disable_output, alpha_ramp, display_level, do_2D_reconstruction(), do_save_img(), fc_ramp, stir::max_filename_length, num_segments_to_combine, stir::Reconstruction< DiscretisedDensity< 3, float > >::output_filename_prefix, PadS, stir::RegisteredParsingObject< Derived, Base, Parent >::parameter_info(), stir::AnalyticReconstruction::proj_data_ptr, stir::AnalyticReconstruction::reconstruct(), and save_intermediate_files.
Referenced by actual_reconstruct(), and do_2D_reconstruction().
|
protected |
Save image data.
References do_save_img(), stir::Array< num_dimensions, elemT >::find_max(), stir::Array< num_dimensions, elemT >::find_min(), stir::Reconstruction< DiscretisedDensity< 3, float > >::output_file_format_ptr, and stir::Array< num_dimensions, elemT >::sum().
Referenced by do_2D_reconstruction(), do_3D_Reconstruction(), and do_save_img().
|
protected |
Read image estimated from 2D FBP.
References do_read_image2D(), image_for_reprojection_filename, and stir::read_from_file().
Referenced by actual_reconstruct(), and do_read_image2D().
|
protected |
3D reconstruction implementation.
References stir::Reconstruction< DiscretisedDensity< 3, float > >::_disable_output, do_3D_Reconstruction(), do_save_img(), stir::Array< num_dimensions, elemT >::find_max(), stir::Array< num_dimensions, elemT >::find_min(), stir::AnalyticReconstruction::max_segment_num_to_process, stir::Reconstruction< DiscretisedDensity< 3, float > >::output_filename_prefix, stir::AnalyticReconstruction::proj_data_ptr, save_intermediate_files, stir::SegmentIndices::segment_num(), stir::Array< num_dimensions, elemT >::sum(), and stir::ViewgramIndices::view_num().
Referenced by actual_reconstruct(), and do_3D_Reconstruction().
|
protected |
|
protected |
Growing 8 viewgrams in both ring and bin directions.
References do_grow3D_viewgram(), stir::DataWithProjDataInfo::get_max_tangential_pos_num(), stir::DataWithProjDataInfo::get_min_tangential_pos_num(), and stir::RelatedViewgrams< elemT >::grow().
Referenced by do_grow3D_viewgram().
|
protected |
3D forward projection implentation by view.
References display_level, do_forward_project_view(), stir::error(), stir::RelatedViewgrams< elemT >::find_max(), and fit_projections.
Referenced by do_forward_project_view().
|
protected |
Apply Colsher filter to 8 viewgrams.
References _PI, alpha_colsher_axial, alpha_colsher_planar, stir::RelatedViewgrams< elemT >::begin(), display_level, do_colsher_filter_view(), stir::RelatedViewgrams< elemT >::end(), stir::error(), fc_colsher_axial, fc_colsher_planar, stir::RelatedViewgrams< elemT >::find_max(), stir::RelatedViewgrams< elemT >::get_basic_segment_num(), stir::DataWithProjDataInfo::get_num_tangential_poss(), stir::RelatedViewgrams< elemT >::get_num_viewgrams(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), stir::AnalyticReconstruction::max_segment_num_to_process, PadS, and PadZ.
Referenced by do_colsher_filter_view().
|
protected |
3D backprojection implentation for 8 viewgrams.
References do_3D_backprojection_view().
Referenced by do_3D_backprojection_view().
|
protected |
Saving CPU timing and values of reconstruction parameters into a log file.
References do_log_file(), stir::TimedObject::get_CPU_timer_value(), stir::max_filename_length, stir::Reconstruction< DiscretisedDensity< 3, float > >::output_filename_prefix, stir::RegisteredParsingObject< FBP3DRPReconstruction, Reconstruction< DiscretisedDensity< 3, float > >, AnalyticReconstruction >::parameter_info(), and stir::warning().
Referenced by actual_reconstruct(), and do_log_file().
|
protected |
Switch to display intermediate images, 0,1,2.
Referenced by actual_reconstruct(), do_2D_reconstruction(), do_colsher_filter_view(), and do_forward_project_view().
|
protected |
Switch to save files after each segment, 0 or 1.
Referenced by do_2D_reconstruction(), and do_3D_Reconstruction().
|
protected |
Filename of image used in the reprojection step (default is empty).
If the filename is empty, FBP is used (with filter parameters as specified further).
Referenced by actual_reconstruct(), and do_read_image2D().
|
protected |
Number of segments to combine with SSRB before calling FBP.
default -1 will use SSRB only when the data are not yet axially compressed
Referenced by do_2D_reconstruction().
|
protected |
Transaxial extension for FFT.
Referenced by do_2D_reconstruction(), and do_colsher_filter_view().
|
protected |
Axial extension for FFT.
Referenced by do_colsher_filter_view().
|
protected |
Ramp filter: Alpha value.
Referenced by do_2D_reconstruction().
|
protected |
Ramp filter: Cut off frequency.
Referenced by do_2D_reconstruction().
|
protected |
Alpha parameter for Colsher filter in axial direction.
Referenced by actual_reconstruct(), and do_colsher_filter_view().
|
protected |
Cut-off frequency for Colsher filter in axial direction.
Referenced by actual_reconstruct(), and do_colsher_filter_view().
|
protected |
Alpha parameter for Colsher filter in planar direction.
Referenced by actual_reconstruct(), and do_colsher_filter_view().
|
protected |
Cut-off frequency for Colsher filter in planar direction.
Referenced by actual_reconstruct(), and do_colsher_filter_view().
|
protected |
Define Colsher at larger size than used for filtering, axial direction.
Referenced by actual_reconstruct().
|
protected |
Define Colsher at larger size than used for filtering, planar direction.
Referenced by actual_reconstruct().
|
protected |
=1 => apply additional fitting procedure to forward projected data (DISABLED)
Referenced by actual_reconstruct(), and do_forward_project_view().