|
23 | 23 | #include "stir/recon_buildblock/ChainedBinNormalisation.h" |
24 | 24 | #include "stir/ProjDataInterfile.h" |
25 | 25 | #include "stir/ProjDataInMemory.h" |
| 26 | +#include "stir/inverse_SSRB.h" |
26 | 27 | #include "stir/ExamInfo.h" |
27 | 28 | #include "stir/ProjDataInfo.h" |
28 | 29 | #include "stir/ProjDataInfoCylindricalNoArcCorr.h" |
@@ -77,6 +78,8 @@ ScatterEstimation::set_defaults() |
77 | 78 | this->override_scanner_template = true; |
78 | 79 | this->override_density_image = true; |
79 | 80 | this->downsample_scanner_bool = true; |
| 81 | + this->downsampled_number_of_rings = -1; |
| 82 | + this->downsampled_detectors_per_ring = -1; |
80 | 83 | this->remove_interleaving = true; |
81 | 84 | this->atten_image_filename = ""; |
82 | 85 | this->atten_coeff_filename = ""; |
@@ -124,6 +127,8 @@ ScatterEstimation::initialise_keymap() |
124 | 127 | this->parser.add_parsing_key("Scatter Simulation type", &this->scatter_simulation_sptr); |
125 | 128 | this->parser.add_key("scatter simulation parameter filename", &this->scatter_sim_par_filename); |
126 | 129 | this->parser.add_key("use scanner downsampling in scatter simulation", &this->downsample_scanner_bool); |
| 130 | + this->parser.add_key("override number of downsampled rings", &this->downsampled_number_of_rings); |
| 131 | + this->parser.add_key("override number of downsampled detectors per ring", &this->downsampled_detectors_per_ring); |
127 | 132 |
|
128 | 133 | this->parser.add_key("override attenuation image", &this->override_density_image); |
129 | 134 | this->parser.add_key("override scanner template", &this->override_scanner_template); |
@@ -597,7 +602,7 @@ ScatterEstimation::set_up() |
597 | 602 | } |
598 | 603 |
|
599 | 604 | if (this->downsample_scanner_bool) |
600 | | - this->scatter_simulation_sptr->downsample_scanner(); |
| 605 | + this->scatter_simulation_sptr->downsample_scanner(this->downsampled_number_of_rings, this->downsampled_detectors_per_ring); |
601 | 606 |
|
602 | 607 | // Check if Load a mask proj_data |
603 | 608 |
|
@@ -834,7 +839,7 @@ ScatterEstimation::process_data() |
834 | 839 | float local_min_scale_value = 0.5f; |
835 | 840 | float local_max_scale_value = 0.5f; |
836 | 841 |
|
837 | | - stir::BSpline::BSplineType spline_type = stir::BSpline::quadratic; |
| 842 | + stir::BSpline::BSplineType spline_type = stir::BSpline::linear; |
838 | 843 |
|
839 | 844 | // This has been set to 2D or 3D in the set_up() |
840 | 845 | shared_ptr<ProjData> unscaled_est_projdata_sptr( |
@@ -1026,16 +1031,13 @@ ScatterEstimation::process_data() |
1026 | 1031 | shared_ptr<BinNormalisation> normalisation_factors_3d_sptr |
1027 | 1032 | = this->get_normalisation_object_sptr(this->multiplicative_binnorm_sptr); |
1028 | 1033 |
|
1029 | | - upsample_and_fit_scatter_estimate(*scatter_estimate_sptr, |
1030 | | - *this->input_projdata_sptr, |
1031 | | - *temp_projdata, |
1032 | | - *normalisation_factors_3d_sptr, |
1033 | | - *this->input_projdata_sptr, |
1034 | | - 1.0f, |
1035 | | - 1.0f, |
1036 | | - 1, |
1037 | | - spline_type, |
1038 | | - false); |
| 1034 | + ProjDataInMemory interpolated_scatter(this->input_projdata_sptr->get_exam_info_sptr(), |
| 1035 | + this->input_projdata_sptr->get_proj_data_info_sptr()->create_shared_clone()); |
| 1036 | + inverse_SSRB(interpolated_scatter, *temp_projdata); |
| 1037 | + normalisation_factors_3d_sptr->set_up(this->input_projdata_sptr->get_exam_info_sptr(), |
| 1038 | + this->input_projdata_sptr->get_proj_data_info_sptr()->create_shared_clone()); |
| 1039 | + normalisation_factors_3d_sptr->undo(interpolated_scatter); |
| 1040 | + scatter_estimate_sptr->fill(interpolated_scatter); |
1039 | 1041 | } |
1040 | 1042 | else |
1041 | 1043 | { |
|
0 commit comments