Skip to content

Commit 6900c9b

Browse files
Merge pull request #1432 from KrisThielemans/WarningFixes
small rationalising of warnings
2 parents d59f784 + ab26b14 commit 6900c9b

File tree

2 files changed

+35
-32
lines changed

2 files changed

+35
-32
lines changed

src/IO/InterfileHeader.cxx

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ InterfilePDFSHeader::post_processing()
10321032
{
10331033
warning("Inconsistent number of TOF bins (" + std::to_string(this->num_timing_poss)
10341034
+ ") and size of the 'TOF bin order' list (" + std::to_string(this->timing_poss_sequence.size()) + ").");
1035-
// return true;
1035+
return true;
10361036
}
10371037
}
10381038

@@ -1042,8 +1042,8 @@ InterfilePDFSHeader::post_processing()
10421042
bool originating_system_was_recognised = guessed_scanner_ptr->get_type() != Scanner::Unknown_scanner;
10431043
if (!originating_system_was_recognised)
10441044
{
1045-
warning("Interfile warning: I did not recognise the scanner from 'originating_system' ("
1046-
+ get_exam_info().originating_system + ")");
1045+
info("Interfile warning: I did not recognise the scanner from 'originating_system' (" + get_exam_info().originating_system
1046+
+ "). Hopefully there is enough information present. I will check this now.");
10471047
}
10481048

10491049
bool mismatch_between_header_and_guess = false;
@@ -1313,35 +1313,37 @@ InterfilePDFSHeader::post_processing()
13131313
// warn if the Interfile header does not provide enough info
13141314

13151315
if (num_rings < 1)
1316-
warning("Interfile warning: 'number of rings' invalid.\n");
1316+
warning("Interfile warning: 'number of rings' invalid.");
13171317
if (num_detectors_per_ring < 1)
1318-
warning("Interfile warning: 'num_detectors_per_ring' invalid.\n");
1318+
warning("Interfile warning: 'num_detectors_per_ring' invalid.");
13191319
#if 0
13201320
if (transaxial_FOV_diameter_in_cm < 0)
1321-
warning("Interfile warning: 'transaxial FOV diameter (cm)' invalid.\n");
1321+
warning("Interfile warning: 'transaxial FOV diameter (cm)' invalid.");
13221322
#endif
13231323
if (inner_ring_diameter_in_cm <= 0)
1324-
warning("Interfile warning: 'inner ring diameter (cm)' invalid. This might disastrous\n");
1325-
if (average_depth_of_interaction_in_cm <= 0)
1326-
warning("Interfile warning: 'average depth of interaction (cm)' invalid. This might be disastrous.\n");
1324+
warning("Interfile warning: 'inner ring diameter (cm)' invalid. This might be disastrous.");
1325+
if (average_depth_of_interaction_in_cm < 0)
1326+
warning("Interfile warning: 'average depth of interaction (cm)' invalid. This might be disastrous.");
13271327
if (distance_between_rings_in_cm <= 0)
1328-
warning("Interfile warning: 'distance between rings (cm)' invalid.\n");
1328+
warning("Interfile warning: 'distance between rings (cm)' invalid.");
13291329
if (default_bin_size_in_cm <= 0)
1330-
warning("Interfile warning: 'default_bin size (cm)' invalid.\n");
1330+
warning("Interfile warning: 'default_bin size (cm)' invalid. This will likely cause problems in image reconstruction "
1331+
"when setting image sizes via 'zoom' etc.");
13311332
if (num_axial_crystals_per_singles_unit <= 0)
1332-
warning("Interfile warning: 'axial crystals per singles unit' invalid.\n");
1333+
warning("Interfile warning: 'axial crystals per singles unit' invalid (but currently only used for ECAT dead-time).");
13331334
if (num_transaxial_crystals_per_singles_unit <= 0)
1334-
warning("Interfile warning: 'transaxial crystals per singles unit' invalid.\n");
1335-
// new variables for block geometry
1336-
if (axial_distance_between_crystals_in_cm <= 0)
1337-
warning("Interfile warning: 'distance between crystals in axial direction (cm)' invalid.\n");
1338-
if (transaxial_distance_between_crystals_in_cm <= 0)
1339-
warning("Interfile warning: 'distance between crystals in transaxial direction (cm)' invalid.\n");
1340-
if (axial_distance_between_blocks_in_cm <= 0)
1341-
warning("Interfile warning: 'distance between blocks in axial direction (cm)' invalid.\n");
1342-
if (transaxial_distance_between_blocks_in_cm <= 0)
1343-
warning("Interfile warning: 'distance between blocks in transaxial direction (cm)' invalid.\n");
1344-
// end of new variables for block geometry
1335+
warning("Interfile warning: 'transaxial crystals per singles unit' invalid (but currently only used for ECAT dead-time)");
1336+
if (scanner_geometry == "BlocksOnCylindrical")
1337+
{
1338+
if (axial_distance_between_crystals_in_cm <= 0)
1339+
warning("Interfile warning: 'distance between crystals in axial direction (cm)' invalid.");
1340+
if (transaxial_distance_between_crystals_in_cm <= 0)
1341+
warning("Interfile warning: 'distance between crystals in transaxial direction (cm)' invalid.");
1342+
if (axial_distance_between_blocks_in_cm <= 0)
1343+
warning("Interfile warning: 'distance between blocks in axial direction (cm)' invalid.");
1344+
if (transaxial_distance_between_blocks_in_cm <= 0)
1345+
warning("Interfile warning: 'distance between blocks in transaxial direction (cm)' invalid.");
1346+
}
13451347
}
13461348

13471349
// finally, we construct a new scanner object with
@@ -1382,8 +1384,8 @@ InterfilePDFSHeader::post_processing()
13821384
|| scanner_sptr_from_file->get_type() == Scanner::User_defined_scanner || mismatch_between_header_and_guess
13831385
|| !is_consistent)
13841386
{
1385-
warning(boost::format("Interfile parsing ended up with the following scanner:\n%s\n")
1386-
% scanner_sptr_from_file->parameter_info());
1387+
info(boost::format("Interfile parsing ended up with the following scanner:\n%s\n")
1388+
% scanner_sptr_from_file->parameter_info());
13871389
}
13881390

13891391
// float azimuthal_angle_sampling =_PI/num_views;

src/recon_buildblock/DataSymmetriesForBins_PET_CartesianGrid.cxx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ DataSymmetriesForBins_PET_CartesianGrid::DataSymmetriesForBins_PET_CartesianGrid
334334
if (fabs(proj_data_info_ptr->get_phi(Bin(0, 0, 0, 0))) > 1.E-4F
335335
&& (this->do_symmetry_90degrees_min_phi || this->do_symmetry_180degrees_min_phi))
336336
{
337-
warning("Disabling symmetries as image is rotated due to phi offset of the scanner.");
337+
info("Disabling symmetries for the projector as image is rotated due to phi offset of the scanner.");
338338
this->do_symmetry_90degrees_min_phi = false;
339339
this->do_symmetry_180degrees_min_phi = false;
340340
}
@@ -344,20 +344,20 @@ DataSymmetriesForBins_PET_CartesianGrid::DataSymmetriesForBins_PET_CartesianGrid
344344
{
345345
if (this->do_symmetry_90degrees_min_phi || this->do_symmetry_180degrees_min_phi)
346346
{
347-
warning("Disabling rotational symmetries with TOF data as this is untested.");
347+
info("Disabling rotational symmetries for the projector with TOF data as this is untested.");
348348
this->do_symmetry_90degrees_min_phi = false;
349349
this->do_symmetry_180degrees_min_phi = false;
350350
}
351351

352352
if (this->do_symmetry_swap_segment)
353353
{
354-
warning("Disabling segment swapping with TOF data as this is untested.");
354+
info("Disabling segment swapping for the projector with TOF data as this is untested.");
355355
this->do_symmetry_swap_segment = false;
356356
}
357357

358358
if (this->do_symmetry_swap_s)
359359
{
360-
warning("Disabling swap s with TOF data as this is untested.");
360+
info("Disabling swap s symmetry for the projector with TOF data as this is untested.");
361361
this->do_symmetry_swap_s = false;
362362
}
363363
}
@@ -368,7 +368,7 @@ DataSymmetriesForBins_PET_CartesianGrid::DataSymmetriesForBins_PET_CartesianGrid
368368
if (this->do_symmetry_90degrees_min_phi || this->do_symmetry_180degrees_min_phi || this->do_symmetry_swap_segment
369369
|| this->do_symmetry_swap_s)
370370
{
371-
warning("Disabling symmetries in transaxial plane as image is shifted");
371+
info("Disabling symmetries for the projector in transaxial plane as image is shifted");
372372
this->do_symmetry_90degrees_min_phi = this->do_symmetry_180degrees_min_phi = this->do_symmetry_swap_segment
373373
= this->do_symmetry_swap_s = false;
374374
}
@@ -405,7 +405,8 @@ DataSymmetriesForBins_PET_CartesianGrid::DataSymmetriesForBins_PET_CartesianGrid
405405
if (this->do_symmetry_90degrees_min_phi || this->do_symmetry_180degrees_min_phi || this->do_symmetry_swap_segment
406406
|| this->do_symmetry_swap_s)
407407
{
408-
warning("Disabling all symmetries except for symmtery_z since they are not implemented in block geometry yet.");
408+
info("Disabling all symmetries for the projector except for symmetry_z since they are not implemented in block "
409+
"geometry yet.");
409410
this->do_symmetry_90degrees_min_phi = this->do_symmetry_180degrees_min_phi = this->do_symmetry_swap_segment
410411
= this->do_symmetry_swap_s = this->do_symmetry_shift_z = false;
411412
}
@@ -447,7 +448,7 @@ DataSymmetriesForBins_PET_CartesianGrid::DataSymmetriesForBins_PET_CartesianGrid
447448
if (this->do_symmetry_90degrees_min_phi || this->do_symmetry_180degrees_min_phi || this->do_symmetry_swap_segment
448449
|| this->do_symmetry_swap_s || this->do_symmetry_shift_z)
449450
{
450-
warning("Disabling all symmetries since they are not implemented in generic geometry.");
451+
info("Disabling all symmetries for the projector since they are not implemented in generic geometry.");
451452
this->do_symmetry_90degrees_min_phi = this->do_symmetry_180degrees_min_phi = this->do_symmetry_swap_segment
452453
= this->do_symmetry_swap_s = this->do_symmetry_shift_z = false;
453454
}

0 commit comments

Comments
 (0)