Skip to content

Commit d4f640e

Browse files
committed
Clean ups.
1 parent 4e0c3de commit d4f640e

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ include(src/cmake/SetC++Version.cmake)
3535

3636
# minimum C++ version required (you can still ask for a more recent one
3737
# by setting CMAKE_CXX_STANDARD)
38-
UseCXX(17)
38+
UseCXX(20)
3939

4040
# set default build-type to Release
4141
if(NOT CMAKE_BUILD_TYPE)
@@ -294,12 +294,12 @@ if(NOT DISABLE_PETSIRD)
294294
get_target_property(_petsird_libs PETSIRD::petsird INTERFACE_LINK_LIBRARIES)
295295

296296
# --- HDF5 ---
297-
if(_petsird_libs MATCHES "HDF5::")
298-
if(DISABLE_HDF5)
299-
message(STATUS "PETSIRD was built with HDF5 → forcing DISABLE_HDF5=OFF")
300-
set(DISABLE_HDF5 OFF CACHE BOOL "disable use of HDF5 libraries" FORCE)
301-
endif()
302-
endif()
297+
# if(_petsird_libs MATCHES "HDF5::")
298+
# if(DISABLE_HDF5)
299+
# message(STATUS "PETSIRD was built with HDF5 → forcing DISABLE_HDF5=OFF")
300+
# set(DISABLE_HDF5 OFF CACHE BOOL "disable use of HDF5 libraries" FORCE)
301+
# endif()
302+
# endif()
303303

304304
# --- nlohmann_json (optional but recommended) ---
305305
if(_petsird_libs MATCHES "nlohmann_json::")

src/buildblock/PETSIRDInfo.cxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,10 @@ PETSIRDInfo::PETSIRDInfo(const petsird::Header& header, std::string scanner_geom
240240
module_pair = petsird::TypeOfModulePair{ type_of_module, type_of_module };
241241

242242
const auto& tof_bin_edges = petsird_scanner_info_sptr->tof_bin_edges[type_of_module][type_of_module];
243-
info(fmt::format("Num. of TOF bins in PETSIRD {}", tof_bin_edges.NumberOfBins()));
243+
info(format("Num. of TOF bins in PETSIRD {}", tof_bin_edges.NumberOfBins()));
244244
if (tof_bin_edges.NumberOfBins() > 1)
245245
{
246-
info(fmt::format(
246+
info(format(
247247
"Since the PETSIRD file has TOF information, STIR will force cylindrical geometry, as long as other things checkout."));
248248
forced_geometry = "cylindrical";
249249
}
@@ -266,7 +266,7 @@ PETSIRDInfo::PETSIRDInfo(const petsird::Header& header, std::string scanner_geom
266266
const std::set<float>& main_axis = vector_utils::get_largest_vector(unique_dim1_values, unique_dim2_values, unique_dim3_values);
267267

268268
int num_transaxial_blocks = numberOfModules / main_axis.size();
269-
info(fmt::format("I deduce that the scanner has {} transaxial number of blocks", num_transaxial_blocks));
269+
info(format("I deduce that the scanner has {} transaxial number of blocks", num_transaxial_blocks));
270270

271271
float radius = 0;
272272
int radius_indx = -1;
@@ -353,7 +353,7 @@ PETSIRDInfo::PETSIRDInfo(const petsird::Header& header, std::string scanner_geom
353353
}
354354

355355
bool has_tile_structure = group2 > 1 && group3 > 1 && (numberOfElementsIndices % (group2 * group3) == 0);
356-
info(fmt::format("Has tile structure: {}", has_tile_structure ? "yes" : "no"));
356+
info(format("Has tile structure: {}", has_tile_structure ? "yes" : "no"));
357357

358358
if (has_tile_structure)
359359
{
@@ -390,20 +390,20 @@ PETSIRDInfo::PETSIRDInfo(const petsird::Header& header, std::string scanner_geom
390390
block_axial_spacing.push_back(std::abs(end - begin));
391391
}
392392

393-
info(fmt::format("I counted {} axial blocks with spacing {}", unique_dim3_values.size(), block_axial_spacing[0]));
393+
info(format("I counted {} axial blocks with spacing {}", unique_dim3_values.size(), block_axial_spacing[0]));
394394
// Check if the cyrcle area is less than 5% different from the polygon
395395
float expected_circle_area = float(M_PI * radius * radius);
396396
float polygon_area
397397
= float(0.5f * unique_angle_modules.size() * radius * radius * std::sin(2.f * float(M_PI) / unique_angle_modules.size()));
398-
info(fmt::format("Circle area: {}, Polygon area: {}, pct {}",
398+
info(format("Circle area: {}, Polygon area: {}, pct {}",
399399
expected_circle_area,
400400
polygon_area,
401401
std::abs(expected_circle_area - polygon_area) / expected_circle_area));
402402
// This is the NeuroLF ratio.
403403
forced_geometry = "BlocksOnCylindrical";
404404
if (std::abs(expected_circle_area - polygon_area) / expected_circle_area < 0.02f || forced_geometry == "cylindrical")
405405
{
406-
info(fmt::format("PETSIRDInfo: The cylindrical area {} is more than 95% matching the polygon area {}. We will presume a "
406+
info(format("PETSIRDInfo: The cylindrical area {} is more than 95% matching the polygon area {}. We will presume a "
407407
"cylindrical configuration.",
408408
expected_circle_area,
409409
polygon_area));
@@ -530,7 +530,7 @@ PETSIRDInfo::PETSIRDInfo(const petsird::Header& header, std::string scanner_geom
530530
// const int num_ax = blocks_per_bucket_axial * num_axial_crystals_per_block;
531531
// const int num_tang = blocks_per_bucket_transaxial * num_trans_crystals_per_block;
532532

533-
info(fmt::format("Tile size (groupSize) = {}", groupSize));
533+
info(format("Tile size (groupSize) = {}", groupSize));
534534

535535
// const uint32_t num_rings = static_cast<uint32_t>(stir_scanner_sptr->get_num_rings());
536536
// const uint32_t num_det = static_cast<uint32_t>(stir_scanner_sptr->get_num_detectors_per_ring());
@@ -597,7 +597,7 @@ PETSIRDInfo::PETSIRDInfo(const petsird::Header& header, std::string scanner_geom
597597

598598
if (petsird_to_stir->size() != stir_to_petsird->size())
599599
{
600-
info(fmt::format("PETSIRDInfo: Map size mismatch! Forward size: {0}\n Reverse size: {1}",
600+
info(format("PETSIRDInfo: Map size mismatch! Forward size: {0}\n Reverse size: {1}",
601601
petsird_to_stir->size(),
602602
stir_to_petsird->size()));
603603

src/include/stir/detail/PETSIRDInfo_helpers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "stir/CartesianCoordinate3D.h"
44
#include <array>
55
#include <set>
6-
#include <fmt/format.h>
6+
#include "stir/format.h"
77
#include "stir/info.h"
88
#include <vector>
99

src/test/test_PETSIRDInfo_helpers.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ PETSIRDTests::test_find_unique_values_1D()
6767
find_unique_values<float>(result, _input);
6868
for (const auto& val : expected)
6969
{
70-
this->check(result.find(val) != result.end(), fmt::format("Value {} should be in the unique set", val));
70+
this->check(result.find(val) != result.end(), format("Value {} should be in the unique set", val));
7171
}
7272
}
7373

@@ -89,7 +89,7 @@ PETSIRDTests::test_find_unique_values_2D()
8989

9090
for (const auto& val : expected)
9191
{
92-
this->check(result.find(val) != result.end(), fmt::format("Value {} should be in the unique set", val));
92+
this->check(result.find(val) != result.end(), format("Value {} should be in the unique set", val));
9393
}
9494
}
9595

0 commit comments

Comments
 (0)