STIR
6.2.0
|
PET single scatter simulation. More...
#include "stir/scatter/SingleScatterSimulation.h"
Public Member Functions | |
SingleScatterSimulation () | |
Default constructor. | |
SingleScatterSimulation (const std::string ¶meter_filename) | |
Constructor with initialisation from parameter file. | |
Succeeded | process_data () override |
std::string | method_info () const override |
gives method information | |
void | ask_parameters () override |
prompts the user to enter parameter values manually | |
Succeeded | set_up () override |
Perform checks and intialisations. | |
![]() | |
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. | |
![]() | |
ScatterSimulation () | |
Default constructor. | |
void | downsample_density_image_for_scatter_points (float _zoom_xy, float _zoom_z, int _size_xy=-1, int _size_z=-1) |
This function is a less powerfull tool than directly zooming the image. However it will check that the downsampling is done in manner compatible with the ScatterSimulation. | |
Succeeded | downsample_scanner (int new_num_rings=-1, int new_num_dets=-1) |
Downsample the scanner keeping the total axial length the same. More... | |
Succeeded | downsample_images_to_scanner_size () |
Downsamples activity and attenuation images to voxel sizes appropriate for the (downsampled) scanner. More... | |
float | detection_efficiency (const float energy) const |
gamma-energy-part of the detection efficiency More... | |
virtual void | write_log (const double simulation_time, const float total_scatter) |
Output the log of the process. | |
void | set_use_cache (const bool) |
Enable/disable caching of line integrals. | |
bool | get_use_cache () const |
Return if line integrals are cached or not. | |
bool | has_template_proj_data_info () const |
bool | has_exam_info () const |
Returns true if template_exam_info_sptr has been set. | |
shared_ptr< ProjData > | get_output_proj_data_sptr () const |
int | get_num_scatter_points () const |
shared_ptr< const ProjDataInfo > | get_template_proj_data_info_sptr () const |
Get the template ProjDataInfo. | |
shared_ptr< const ExamInfo > | get_exam_info_sptr () const |
Get the ExamInfo. | |
const DiscretisedDensity< 3, float > & | get_activity_image () const |
const DiscretisedDensity< 3, float > & | get_attenuation_image () const |
const DiscretisedDensity< 3, float > & | get_attenuation_image_for_scatter_points () const |
shared_ptr< const DiscretisedDensity< 3, float > > | get_density_image_for_scatter_points_sptr () const |
void | set_template_proj_data_info (const std::string &) |
void | set_template_proj_data_info (const ProjDataInfo &) |
void | set_activity_image_sptr (const shared_ptr< const DiscretisedDensity< 3, float >>) |
void | set_activity_image (const std::string &filename) |
void | set_exam_info (const ExamInfo &) |
void | set_exam_info_sptr (const shared_ptr< const ExamInfo >) |
void | set_output_proj_data_sptr (shared_ptr< ProjData >) |
void | set_density_image_sptr (const shared_ptr< const DiscretisedDensity< 3, float >>) |
void | set_density_image (const std::string &) |
void | set_output_proj_data (const std::string &) |
This function depends on the ProjDataInfo of the scanner. You first have to set that. | |
void | set_output_proj_data_sptr (const shared_ptr< const ExamInfo >, const shared_ptr< const ProjDataInfo >, const std::string &) |
void | set_density_image_for_scatter_points_sptr (shared_ptr< const DiscretisedDensity< 3, float >>) |
void | set_image_downsample_factors (float factor_xy=1.f, float factor_z=1.f, int _size_zoom_xy=-1, int _size_zoom_z=-1) |
void | set_density_image_for_scatter_points (const std::string &) |
set_density_image_for_scatter_points | |
void | set_attenuation_threshold (const float) |
set the attenuation threshold | |
void | set_randomly_place_scatter_points (const bool) |
The scattering point in the voxel will be chosen randomly, instead of choosing the centre. More... | |
void | set_cache_enabled (const bool) |
void | set_downsample_scanner_bool (const bool arg) |
Get and set methods for the downsample_scanner_bool. | |
bool | get_downsample_scanner_bool () const |
int | get_num_downsample_scanner_rings () const |
Get and set methods for downsample_scanner_rings. | |
void | set_num_downsample_scanner_rings (const int arg) |
int | get_num_downsample_scanner_dets () const |
Get and set methods for downsample_scanner_dets. | |
void | set_num_downsample_scanner_dets (const int arg) |
![]() | |
ParsingObject (const ParsingObject &) | |
ParsingObject & | operator= (const ParsingObject &) |
void | ask_parameters () |
bool | parse (std::istream &f) |
bool | parse (const char *const filename) |
Static Public Attributes | |
static const char *const | registered_name = "PET Single Scatter Simulation" |
Name which will be used when parsing a ScatterSimulation object. | |
Protected Member Functions | |
void | initialise (const std::string ¶meter_filename) |
void | set_defaults () override |
Set defaults before parsing. | |
void | initialise_keymap () override |
Initialise all keywords. | |
bool | post_processing () override |
used to check acceptable parameter ranges, etc... | |
double | simulate_for_one_scatter_point (const std::size_t scatter_point_num, const unsigned det_num_A, const unsigned det_num_B) |
simulate single scatter for one scatter point | |
double | scatter_estimate (const Bin &bin) override |
virtual function that computes the scatter for one (downsampled) bin | |
virtual void | actual_scatter_estimate (double &scatter_ratio_singles, const unsigned det_num_A, const unsigned det_num_B) |
![]() | |
virtual double | process_data_for_view_segment_num (const ViewSegmentNumbers &vs_num) |
computes scatter for one viewgram More... | |
float | compute_emis_to_det_points_solid_angle_factor (const CartesianCoordinate3D< float > &emis_point, const CartesianCoordinate3D< float > &detector_coord) |
void | sample_scatter_points () |
find scatter points More... | |
virtual void | remove_cache_for_integrals_over_attenuation () |
remove cached attenuation integrals More... | |
virtual void | remove_cache_for_integrals_over_activity () |
reset cached activity integrals More... | |
void | initialise_cache_for_scattpoint_det_integrals_over_attenuation () |
set-up cache for attenuation integrals More... | |
void | initialise_cache_for_scattpoint_det_integrals_over_activity () |
set-up cache for activity integrals More... | |
virtual void | find_detectors (unsigned &det_num_A, unsigned &det_num_B, const Bin &bin) const |
unsigned | find_in_detection_points_vector (const CartesianCoordinate3D< float > &coord) const |
double | detection_efficiency_no_scatter (const unsigned det_num_A, const unsigned det_num_B) const |
average detection efficiency of unscattered counts | |
float | exp_integral_over_attenuation_image_between_scattpoint_det (const CartesianCoordinate3D< float > &scatter_point, const CartesianCoordinate3D< float > &detector_coord) |
float | integral_over_activity_image_between_scattpoint_det (const CartesianCoordinate3D< float > &scatter_point, const CartesianCoordinate3D< float > &detector_coord) |
float | cached_integral_over_activity_image_between_scattpoint_det (const unsigned scatter_point_num, const unsigned det_num) |
float | cached_exp_integral_over_attenuation_image_between_scattpoint_det (const unsigned scatter_point_num, const unsigned det_num) |
![]() | |
virtual void | set_key_values () |
This will be called before parsing or parameter_info is called. More... | |
Additional Inherited Members | |
![]() | |
static ScatterSimulation * | read_from_stream (std::istream *) |
Construct a new object (of type Derived) by parsing the istream. More... | |
![]() | |
static float | dif_Compton_cross_section (const float cos_theta, float energy) |
static float | total_Compton_cross_section (float energy) |
static float | photon_energy_after_Compton_scatter (const float cos_theta, const float energy) |
static float | photon_energy_after_Compton_scatter_511keV (const float cos_theta) |
static float | total_Compton_cross_section_relative_to_511keV (const float energy) |
![]() | |
static ScatterSimulation * | 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. More... | |
static ScatterSimulation * | ask_type_and_parameters () |
ask the user for the type, and then calls read_registered_object(0, type) More... | |
static void | list_registered_names (std::ostream &stream) |
List all possible registered names to the stream. More... | |
![]() | |
enum | image_type { act_image_type, att_image_type } |
![]() | |
typedef ScatterSimulation *(* | 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 float | max_cos_angle (const float low, const float approx, const float resolution_at_511keV) |
maximum angle to consider above which detection after Compton scatter is considered too small | |
static float | energy_lower_limit (const float low, const float approx, const float resolution_at_511keV) |
mimumum energy to consider above which detection after Compton scatter is considered too small | |
static float | integral_between_2_points (const DiscretisedDensity< 3, float > &density, const CartesianCoordinate3D< float > &point1, const CartesianCoordinate3D< float > &point2) |
![]() | |
static RegistryType & | registry () |
Static function returning the registry. More... | |
![]() | |
std::vector< ScatterPoint > | scatt_points_vector |
float | scatter_volume |
std::string | template_proj_data_filename |
shared_ptr< ProjDataInfo > | proj_data_info_sptr |
shared_ptr< ExamInfo > | template_exam_info_sptr |
std::string | density_image_filename |
std::string | density_image_for_scatter_points_filename |
std::string | density_image_for_scatter_points_output_filename |
shared_ptr< const DiscretisedDensity< 3, float > > | density_image_sptr |
shared_ptr< const DiscretisedDensity< 3, float > > | activity_image_sptr |
Pointer to hold the current activity estimation. | |
std::string | output_proj_data_filename |
Output proj_data fileanme prefix. | |
shared_ptr< ProjData > | output_proj_data_sptr |
Shared ptr to hold the simulated data. | |
float | attenuation_threshold |
threshold below which a voxel in the attenuation image will not be considered as a candidate scatter point | |
bool | randomly_place_scatter_points |
boolean to see if we need to move the scatter point randomly within in its voxel | |
bool | use_cache |
boolean to see if we need to cache the integrals More... | |
std::string | activity_image_filename |
Filename for the initial activity estimate. | |
float | zoom_xy |
Zoom factor on plane XY. Defaults on 1.f. | |
float | zoom_z |
Zoom factor on Z axis. Defaults on 1.f. | |
int | zoom_size_xy |
Zoomed image size on plane XY. Defaults on -1. | |
int | zoom_size_z |
Zoomed image size on Z axis. Defaults on -1. | |
int | downsample_scanner_rings |
Number of rings of downsampled scanner. | |
int | downsample_scanner_dets |
Number of detectors per ring of downsampled scanner. | |
bool | downsample_scanner_bool |
bool | _already_set_up |
CartesianCoordinate3D< float > | shift_detector_coordinates_to_origin |
std::vector< CartesianCoordinate3D< float > > | detection_points_vector |
![]() | |
KeyParser | parser |
PET single scatter simulation.