diff --git a/src/IO/MultiDynamicDiscretisedDensityOutputFileFormat.cxx b/src/IO/MultiDynamicDiscretisedDensityOutputFileFormat.cxx index 4542fcabd..7ee8c09dc 100644 --- a/src/IO/MultiDynamicDiscretisedDensityOutputFileFormat.cxx +++ b/src/IO/MultiDynamicDiscretisedDensityOutputFileFormat.cxx @@ -93,7 +93,7 @@ MultiDynamicDiscretisedDensityOutputFileFormat::actual_write_to_file(std::string // Create all the filenames VectorWithOffset individual_filenames(1, int(density.get_num_time_frames())); for (int i = 1; i <= int(density.get_num_time_frames()); i++) - individual_filenames[i] = filename + "_" + boost::lexical_cast(i); + individual_filenames[i] = filename + "_" + std::to_string(i); // Write each individual image for (int i = 1; i <= int(density.get_num_time_frames()); i++) diff --git a/src/IO/MultiParametricDiscretisedDensityOutputFileFormat.cxx b/src/IO/MultiParametricDiscretisedDensityOutputFileFormat.cxx index 126c5bd5f..b065304d8 100644 --- a/src/IO/MultiParametricDiscretisedDensityOutputFileFormat.cxx +++ b/src/IO/MultiParametricDiscretisedDensityOutputFileFormat.cxx @@ -106,7 +106,7 @@ ParamDiscDensityOutputFileFormat::actual_write_to_file(std::string& filename, // Create all the filenames VectorWithOffset individual_filenames(1, int(density.get_num_params())); for (int i = 1; i <= int(density.get_num_params()); i++) - individual_filenames[i] = filename + "_" + boost::lexical_cast(i); + individual_filenames[i] = filename + "_" + std::to_string(i); // Write each individual image for (int i = 1; i <= int(density.get_num_params()); i++) diff --git a/src/include/stir/common.h b/src/include/stir/common.h index 5a501a040..c28a0456d 100644 --- a/src/include/stir/common.h +++ b/src/include/stir/common.h @@ -72,7 +72,9 @@ #include #include #include -#include +#if __cplusplus >= 202002L +# include +#endif //*************** namespace macros #define START_NAMESPACE_STIR \ @@ -128,10 +130,16 @@ //*************** START_NAMESPACE_STIR +#ifndef _PI +# if __cplusplus >= 202002L //! The constant pi to high precision. /*! \ingroup buildblock */ -#ifndef _PI -# define _PI boost::math::constants::pi() +# define _PI std::numbers::pi +# else +//! The constant pi to high precision. +/*! \ingroup buildblock */ +# define _PI 3.1415926535897932384626433832795028841971693993751058209749445923078164062 +# endif #endif //! Define the speed of light in mm / ps diff --git a/src/include/stir/recon_buildblock/ML_estimate_component_based_normalisation.h b/src/include/stir/recon_buildblock/ML_estimate_component_based_normalisation.h index f7fa35ce6..9fcbc0650 100644 --- a/src/include/stir/recon_buildblock/ML_estimate_component_based_normalisation.h +++ b/src/include/stir/recon_buildblock/ML_estimate_component_based_normalisation.h @@ -9,10 +9,11 @@ /*! \file \ingroup recon_buildblock - \brief Declaration of ML_estimate_component_based_normalisation + \brief Declaration of stir::ML_estimate_component_based_normalisation \author Kris Thielemans */ #include "stir/common.h" +#include START_NAMESPACE_STIR diff --git a/src/include/stir/warning.h b/src/include/stir/warning.h index 7d7fc5678..317aee04b 100644 --- a/src/include/stir/warning.h +++ b/src/include/stir/warning.h @@ -17,11 +17,9 @@ \author Kris Thielemans */ -#include "stir/common.h" #include "stir/Verbosity.h" -#include - -#include "TextWriter.h" +#include "stir/TextWriter.h" +#include START_NAMESPACE_STIR diff --git a/src/recon_buildblock/BinNormalisationSPECT.cxx b/src/recon_buildblock/BinNormalisationSPECT.cxx index 43971d715..5b3ec1689 100644 --- a/src/recon_buildblock/BinNormalisationSPECT.cxx +++ b/src/recon_buildblock/BinNormalisationSPECT.cxx @@ -318,7 +318,7 @@ BinNormalisationSPECT::read_uniformity_table(Array<3, float>& uniformity) const for (int n = 1; n <= num_detector_heads; n++) { - const std::string n_string = boost::lexical_cast(n); + const std::string n_string = std::to_string(n); const std::string filename(this->folder_prefix + n_string + "/" + uniformity_filename); std::ifstream input(filename.c_str());