12 #ifndef __stir_scatter_ScatterSimulation_H__ 13 #define __stir_scatter_ScatterSimulation_H__ 95 virtual std::string method_info()
const = 0;
97 virtual void ask_parameters();
100 inline bool has_template_proj_data_info()
const {
return !stir::is_null_ptr(proj_data_info_sptr); }
102 inline bool has_exam_info()
const {
return !stir::is_null_ptr(template_exam_info_sptr); }
107 shared_ptr<ProjData> get_output_proj_data_sptr()
const;
109 inline int get_num_scatter_points()
const {
return static_cast<int>(this->scatt_points_vector.size()); }
111 shared_ptr<const ProjDataInfo> get_template_proj_data_info_sptr()
const;
113 shared_ptr<const ExamInfo> get_exam_info_sptr()
const;
119 shared_ptr<const DiscretisedDensity<3, float>> get_density_image_for_scatter_points_sptr()
const;
125 void set_template_proj_data_info(
const std::string&);
131 void set_activity_image(
const std::string& filename);
134 void set_exam_info(
const ExamInfo&);
135 void set_exam_info_sptr(
const shared_ptr<const ExamInfo>);
137 void set_output_proj_data_sptr(shared_ptr<ProjData>);
141 void set_density_image(
const std::string&);
144 void set_output_proj_data(
const std::string&);
146 void set_output_proj_data_sptr(
const shared_ptr<const ExamInfo>,
const shared_ptr<const ProjDataInfo>,
const std::string&);
150 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);
152 void set_density_image_for_scatter_points(
const std::string&);
154 void set_attenuation_threshold(
const float);
162 void set_randomly_place_scatter_points(
const bool);
164 void set_cache_enabled(
const bool);
171 void downsample_density_image_for_scatter_points(
float _zoom_xy,
float _zoom_z,
int _size_xy = -1,
int _size_z = -1);
175 void set_downsample_scanner_bool(
const bool arg);
176 bool get_downsample_scanner_bool()
const;
181 int get_num_downsample_scanner_rings()
const;
182 void set_num_downsample_scanner_rings(
const int arg);
187 int get_num_downsample_scanner_dets()
const;
188 void set_num_downsample_scanner_dets(
const int arg);
195 Succeeded downsample_scanner(
int new_num_rings = -1,
int new_num_dets = -1);
204 Succeeded downsample_images_to_scanner_size();
218 float detection_efficiency(
const float energy)
const;
222 static inline float dif_Compton_cross_section(
const float cos_theta,
float energy);
224 static inline float total_Compton_cross_section(
float energy);
226 static inline float photon_energy_after_Compton_scatter(
const float cos_theta,
const float energy);
228 static inline float photon_energy_after_Compton_scatter_511keV(
const float cos_theta);
230 static inline float total_Compton_cross_section_relative_to_511keV(
const float energy);
236 virtual void write_log(
const double simulation_time,
const float total_scatter);
239 void set_use_cache(
const bool);
241 bool get_use_cache()
const;
251 void set_defaults()
override;
252 void initialise_keymap()
override;
256 bool post_processing()
override;
269 std::vector<ScatterPoint> scatt_points_vector;
271 float scatter_volume;
277 void sample_scatter_points();
282 virtual void remove_cache_for_integrals_over_attenuation();
287 virtual void remove_cache_for_integrals_over_activity();
294 static float max_cos_angle(
const float low,
const float approx,
const float resolution_at_511keV);
298 static float energy_lower_limit(
const float low,
const float approx,
const float resolution_at_511keV);
300 virtual void find_detectors(
unsigned& det_num_A,
unsigned& det_num_B,
const Bin& bin)
const;
307 double detection_efficiency_no_scatter(
const unsigned det_num_A,
const unsigned det_num_B)
const;
310 mutable std::vector<CartesianCoordinate3D<float>> detection_points_vector;
315 virtual double scatter_estimate(
const Bin& bin) = 0;
329 float cached_integral_over_activity_image_between_scattpoint_det(
const unsigned scatter_point_num,
const unsigned det_num);
331 float cached_exp_integral_over_attenuation_image_between_scattpoint_det(
const unsigned scatter_point_num,
332 const unsigned det_num);
335 std::string template_proj_data_filename;
337 shared_ptr<ProjDataInfo> proj_data_info_sptr;
341 std::string density_image_filename;
343 std::string density_image_for_scatter_points_filename;
345 std::string density_image_for_scatter_points_output_filename;
347 shared_ptr<const DiscretisedDensity<3, float>> density_image_sptr;
356 void initialise_cache_for_scattpoint_det_integrals_over_attenuation();
361 void initialise_cache_for_scattpoint_det_integrals_over_activity();
393 bool downsample_scanner_bool;
394 bool _already_set_up;
401 shared_ptr<DiscretisedDensity<3, float>> density_image_for_scatter_points_sptr;
404 mutable float detector_efficiency_no_scatter;
int zoom_size_xy
Zoomed image size on plane XY. Defaults on -1.
Definition: ScatterSimulation.h:385
int downsample_scanner_dets
Number of detectors per ring of downsampled scanner.
Definition: ScatterSimulation.h:391
inline functions of stir::ScatterSimulation (cross sections)
shared_ptr< ExamInfo > template_exam_info_sptr
Definition: ScatterSimulation.h:339
Declaration of class stir::ProjDataInfoCylindricalNoArcCorr.
Declaration of class stir::ParsingObject.
float zoom_z
Zoom factor on Z axis. Defaults on 1.f.
Definition: ScatterSimulation.h:383
Declaration of class stir::ProjData.
bool randomly_place_scatter_points
boolean to see if we need to move the scatter point randomly within in its voxel
Definition: ScatterSimulation.h:372
int zoom_size_z
Zoomed image size on Z axis. Defaults on -1.
Definition: ScatterSimulation.h:387
bool has_exam_info() const
Returns true if template_exam_info_sptr has been set.
Definition: ScatterSimulation.h:102
std::string activity_image_filename
Filename for the initial activity estimate.
Definition: ScatterSimulation.h:379
int downsample_scanner_rings
Number of rings of downsampled scanner.
Definition: ScatterSimulation.h:389
alias for ViewgramIndices
Definition: ViewSegmentNumbers.h:33
Declaration of class stiir::RegisteredObject.
A class for storing coordinates and value of a single projection bin.
Definition: Bin.h:48
Helper class to provide registry mechanisms to a Base classSuppose you have a hierarchy of classes wi...
Definition: RegisteredObject.h:95
bool use_cache
boolean to see if we need to cache the integrals
Definition: ScatterSimulation.h:377
std::string output_proj_data_filename
Output proj_data fileanme prefix.
Definition: ScatterSimulation.h:364
float zoom_xy
Zoom factor on plane XY. Defaults on 1.f.
Definition: ScatterSimulation.h:381
Declaration of class stir::ProjDataInfoGenericNoArcCorr.
a class for storing information about 1 exam (or scan)
Definition: ExamInfo.h:41
Simulate the scatter probability using a model-based approach.
Definition: ScatterSimulation.h:85
Declaration of class stir::ProjDataInfoBlocksOnCylindricalNoArcCorr.
float attenuation_threshold
threshold below which a voxel in the attenuation image will not be considered as a candidate scatter ...
Definition: ScatterSimulation.h:369
defines the stir::VoxelsOnCartesianGrid class
An (abstract base) class that contains information on the projection data.
Definition: ProjDataInfo.h:69
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
shared_ptr< const DiscretisedDensity< 3, float > > activity_image_sptr
Pointer to hold the current activity estimation.
Definition: ScatterSimulation.h:350
shared_ptr< ProjData > output_proj_data_sptr
Shared ptr to hold the simulated data.
Definition: ScatterSimulation.h:366