Skip to content

Commit d26b68a

Browse files
replace std::cout calls with info()
1 parent 7eea917 commit d26b68a

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

src/include/stir/Scanner.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ class Succeeded;
8787
coincidence window then the reconstruction will essential be nonTOF but the
8888
projector will restrict the size of the LOR to the size of the coincidence window.
8989
\li \c The scanner will be classified as TOF enabled when the numer of TOF bins and
90-
TOF bin size are >1 and >0, respectively. If the timing resolution is not set that will be fine
91-
as long as the final TOF possitions is 1. Then we just restict the size of the LOR.
90+
TOF bin size are >1 and >0, respectively. If the timing resolution is not set, we will attempt to handle this if the number TOF positions is 1 (the projector will then just use the bin-size to restrict the size of the LOR).
9291
9392
A further complication is that some scanners (including many Siemens scanners)
9493
insert virtual crystals in the sinogram data (corresponding to gaps between

src/recon_buildblock/ML_estimate_component_based_normalisation.cxx

+17-19
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ ML_estimate_component_based_normalisation(const std::string& out_filename_prefix
9494

9595
FanProjData model_fan_data;
9696
FanProjData fan_data;
97-
std::cout << "Allocating ..." << std::endl;
97+
info("Allocating memory ...", 3);
9898
DetectorEfficiencies data_fan_sums(IndexRange2D(num_physical_rings, num_physical_detectors_per_ring));
9999
DetectorEfficiencies efficiencies(IndexRange2D(num_physical_rings, num_physical_detectors_per_ring));
100100

@@ -151,9 +151,8 @@ ML_estimate_component_based_normalisation(const std::string& out_filename_prefix
151151
model_fan_data_sum += *local_model_fan_data_sum[i];
152152

153153
local_model_fan_data_sum.clear();
154-
std::cout << "Model sum: " << model_fan_data_sum << std::endl;
154+
info("Model sum of fan data: " + std::to_string(model_fan_data_sum), 3);
155155
}
156-
std::cout << ">>><<<: " << std::endl;
157156
{
158157
// next could be local if KL is not computed below
159158
FanProjData measured_fan_data;
@@ -196,16 +195,16 @@ ML_estimate_component_based_normalisation(const std::string& out_filename_prefix
196195
// to avoid divisions by zero.
197196
data_fan_sum = make_all_fan_data_from_cache(measured_fan_data, measured_data, model_fan_data);
198197
float dd = data_fan_sums.find_max();
199-
std::cout << "Data fan sum max " << dd << std::endl;
198+
info("Data fan sum max: " + std::to_string(dd), 3);
200199
threshold_for_KL =dd / 100000000.F;
201200

202-
std::cout << "1. Making fan sum data .. " << std::endl;
201+
info("1. Making fan sum data .. ", 3);
203202
make_fan_sum_data(data_fan_sums, measured_fan_data);
204-
std::cout << "fan sum data min/max " << data_fan_sums.find_min() << " " << data_fan_sums.find_max() << std::endl;
203+
info("fan sum data min/max " + std::to_string(data_fan_sums.find_min()) + "/" + std::to_string(data_fan_sums.find_max()), 3);
205204

206-
std::cout << "2. Making fan geo data .. " << std::endl;
205+
info("2. Making fan geo data .. ", 3);
207206
make_geo_data(measured_geo_data, measured_fan_data);
208-
std::cout << "measured_geo_data min/max " << measured_geo_data.find_min() << " " << measured_geo_data.find_max() << std::endl;
207+
info("measured_geo_data min/max " + std::to_string(measured_geo_data.find_min()) + "/" + std::to_string(measured_geo_data.find_max()), 3);;
209208
}
210209
if (do_display && do_block)
211210
display(measured_block_data, "raw block data from measurements");
@@ -239,32 +238,31 @@ ML_estimate_component_based_normalisation(const std::string& out_filename_prefix
239238
std::cout << "Iteration number: " << iter_num << std::endl;
240239
if (iter_num == 1)
241240
{
242-
std::cout << "Calculating sums: " << std::endl;
241+
info("Calculating sums om fan_data ...", 3);
243242
float value = sqrt(data_fan_sum / model_fan_data_sum);
244-
std::cout << "Ratio: " << value << std::endl;
243+
info("Ratio: " + std::to_string(value), 3);
245244
efficiencies.fill(value);
246-
std::cout << "Finished sums." << std::endl;
247245
norm_geo_data.fill(1);
248246
norm_block_data.fill(1);
249247
}
250248
// efficiencies
251249
{
252-
std::cout << "Copying model to fan_data..." << std::endl;
250+
info("Copying model to fan_data...", 3);
253251
fan_data = model_fan_data;
254-
std::cout << "Applying geo norm..." << std::endl;
252+
info("Applying geo norm...", 3);
255253
apply_geo_norm(fan_data, norm_geo_data);
256254
if (do_block)
257255
{
258-
std::cout << "Applying block norm..." << std::endl;
256+
info("Applying block norm...", 3);
259257
apply_block_norm(fan_data, norm_block_data);
260258
}
261259
if (do_display)
262260
display(fan_data, "model*geo*block");
263261
for (int eff_iter_num = 1; eff_iter_num <= num_eff_iterations; ++eff_iter_num)
264262
{
265-
std::cout << "Efficiency iteration number: " << iter_num << std::endl;
263+
info("Efficiency iteration number: " + std::to_string(iter_num), 3);
266264
iterate_efficiencies(efficiencies, data_fan_sums, fan_data);
267-
std::cout << "Finished efficiency iteration number: " << iter_num << std::endl;
265+
info("Finished efficiency iteration", 3);
268266
{
269267
char* out_filename = new char[out_filename_prefix.size() + 30];
270268
sprintf(out_filename, "%s_%s_%d_%d.out", out_filename_prefix.c_str(), "eff", iter_num, eff_iter_num);
@@ -274,7 +272,7 @@ ML_estimate_component_based_normalisation(const std::string& out_filename_prefix
274272
}
275273
if (do_KL)
276274
{
277-
std::cout << "Calculating KL" << std::endl;
275+
info("Calculating KL", 3);
278276
apply_efficiencies(fan_data, efficiencies);
279277
std::cerr << "measured*norm min " << measured_fan_data.find_min() << " ,max " << measured_fan_data.find_max()
280278
<< std::endl;
@@ -302,8 +300,8 @@ ML_estimate_component_based_normalisation(const std::string& out_filename_prefix
302300
}
303301
} // end efficiencies
304302

305-
std::cout << "geo norm" << std::endl;
306-
std::cout << "Copying model to fan_data..." << std::endl;
303+
info("Starting geo norm", 3);
304+
info("Copying model to fan_data...", 3);
307305
fan_data = model_fan_data;
308306
apply_efficiencies(fan_data, efficiencies);
309307
if (do_block)

src/utilities/construct_fanProjData_fromProjData.cxx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
\file
55
\ingroup utilities
66
7-
\brief Construct FanProjData from ProjData
7+
\brief Construct stir::FanProjData from stir::ProjData
88
99
\author Nikos Efthimiou
1010

0 commit comments

Comments
 (0)